J
Jim Heavey
Hello, I am looking a coding example that allows you to add toolTips to a
column in a datagrid. It works just fine ins the supplied code, but when I
attempt to apply it to my program, it fails with a out of bounds exception.
The example is applying toolTip to a HyperLinkColumn, which is the first
column in the datagrid, and I am attempting to apply it to a "BoundColumn".
Here is the code...
Dim liType As ListItemType = e.Item.ItemType
If liType = ListItemType.Item Or liType = ListItemType.AlternatingItem Then
Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim cellValue = e.Item.Cells(0).Text
Dim control As Control = e.Item.Cells(0).Controls(0)
CType(e.Item.Cells(0).Controls(0), WebControl).ToolTip = "My Custom
ToolTip"
End If
Last line of the If Statement is the one failing. I looked at the
"WebControl" class and BoundColumn is one of the controls apllicable. Why is
it failing?
column in a datagrid. It works just fine ins the supplied code, but when I
attempt to apply it to my program, it fails with a out of bounds exception.
The example is applying toolTip to a HyperLinkColumn, which is the first
column in the datagrid, and I am attempting to apply it to a "BoundColumn".
Here is the code...
Dim liType As ListItemType = e.Item.ItemType
If liType = ListItemType.Item Or liType = ListItemType.AlternatingItem Then
Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim cellValue = e.Item.Cells(0).Text
Dim control As Control = e.Item.Cells(0).Controls(0)
CType(e.Item.Cells(0).Controls(0), WebControl).ToolTip = "My Custom
ToolTip"
End If
Last line of the If Statement is the one failing. I looked at the
"WebControl" class and BoundColumn is one of the controls apllicable. Why is
it failing?