Highlight linkbutton in gridview for a certain row

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top