Highlight linkbutton in gridview for a certain row

Discussion in 'ASP .Net Web Controls' started by Chris Davoli, Apr 27, 2007.

  1. Chris Davoli

    Chris Davoli Guest

    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


    --
    Chris Davoli
    Chris Davoli, Apr 27, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernando Lopes
    Replies:
    0
    Views:
    3,177
    Fernando Lopes
    Apr 28, 2005
  2. Marc Pavo
    Replies:
    1
    Views:
    641
    Marc Pavo
    Nov 17, 2006
  3. -Steve-

    GridView Highlight Certain Rows

    -Steve-, Sep 12, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    426
    marss
    Sep 12, 2007
  4. Replies:
    2
    Views:
    501
    bruce barker
    Mar 25, 2008
  5. Feege

    Highlight row in a gridview after formview insert

    Feege, Jan 9, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    298
    Wouter van Vugt
    Jan 11, 2006
Loading...

Share This Page