![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| 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 Did I help you out? Make me popular by clicking the icon!If you found a post helpful, please click the button in the lower right-hand corner of the post.Powered by ASP.Net |
| Sponsored Links |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. Web Directory & SEO Services dirroot web directory |