C
Chris Davoli
How do you Highlight a linkbutton in a gridview for a certain row? I want to
do this in the ItemDataBound event. Here is my code but it doesn't work.
LinkButton is column 1.
Protected Sub dgFormulaGrid_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgFormulaGrid.ItemDataBound
If e.Item.ItemType <> ListItemType.Header AndAlso e.Item.ItemType <>
ListItemType.Footer Then
e.Item.Cells(5).Text = CType(e.Item.Cells(5).Text, Double)
e.Item.Cells(6).Text = CType(e.Item.Cells(6).Text, Date)
e.Item.Cells(7).Text = CType(e.Item.Cells(7).Text, Date)
If CType(e.Item.FindControl("CheckBox1"), CheckBox).Checked =
False Then
e.Item.Cells(1).Font.Bold = True
e.Item.Font.Bold = True
End If
End If
End Sub
do this in the ItemDataBound event. Here is my code but it doesn't work.
LinkButton is column 1.
Protected Sub dgFormulaGrid_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgFormulaGrid.ItemDataBound
If e.Item.ItemType <> ListItemType.Header AndAlso e.Item.ItemType <>
ListItemType.Footer Then
e.Item.Cells(5).Text = CType(e.Item.Cells(5).Text, Double)
e.Item.Cells(6).Text = CType(e.Item.Cells(6).Text, Date)
e.Item.Cells(7).Text = CType(e.Item.Cells(7).Text, Date)
If CType(e.Item.FindControl("CheckBox1"), CheckBox).Checked =
False Then
e.Item.Cells(1).Font.Bold = True
e.Item.Font.Bold = True
End If
End If
End Sub