![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| The following allows you to add a tooltip to the header links of your GridView, a feature that is lacking. VB.Net Code: Code: Private Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound
'//Check the row type is header
If e.Row.RowType = DataControlRowType.Header Then
For Each cell As TableCell In e.Row.Cells
For Each ctrl As Control In cell.Controls
If ctrl.GetType().ToString().Contains("DataControlLinkButton") Then
cell.Attributes.Add("title", CType(ctrl, LinkButton).Text)
End If
Next
Next
End If
End Sub
Code: private void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
////Check the row type is header
if (e.Row.RowType == DataControlRowType.Header) {
foreach (TableCell cell in e.Row.Cells) {
foreach (Control ctrl in cell.Controls) {
if (ctrl.GetType().ToString().Contains("DataControlLinkButton")) {
cell.Attributes.Add("title", ((LinkButton)ctrl).Text);
}
}
}
}
}
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
| Sponsored Links |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Form Design: Label in Header Control in details | nboscaino | Microsoft Access | 2 | August 28th, 2008 06:03 PM |
| Is there an easier way to create a countif function? | Lauramc | Visual Basic Programming | 0 | August 7th, 2008 06:26 PM |
| Create History Table / Outcome results | Rebelle | Database Design Help | 9 | July 1st, 2008 08:33 AM |
| add additional footer to gridview | peebman2000 | .Net Development | 13 | May 2nd, 2008 01:50 PM |
| Create Virtual Directories in IIS | jmurrayhead | Microsoft IIS | 0 | March 21st, 2008 10:08 AM |