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. Advertisements

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,376
    Fernando Lopes
    Apr 28, 2005
  2. H5N1
    Replies:
    0
    Views:
    2,985
  3. Marc Pavo
    Replies:
    1
    Views:
    769
    Marc Pavo
    Nov 17, 2006
  4. -Steve-

    GridView Highlight Certain Rows

    -Steve-, Sep 12, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    530
    marss
    Sep 12, 2007
  5. Replies:
    2
    Views:
    737
    bruce barker
    Mar 25, 2008
  6. Feege

    Highlight row in a gridview after formview insert

    Feege, Jan 9, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    438
    Wouter van Vugt
    Jan 11, 2006
  7. ASMJ
    Replies:
    0
    Views:
    301
  8. Chris

    Highlight a clicked row in a gridview linked to a css

    Chris, Feb 8, 2007, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    346
    Steven Cheng[MSFT]
    Feb 13, 2007
Loading...