gridview rowdatabound change cssclass and selectedrowstyle cssclasshelp

Discussion in 'ASP .Net Web Controls' started by Peter, May 10, 2007.

  1. Peter

    Peter Guest

    Hello All

    I was wondering if someone can help me out with this

    I added a piece of code to change the background color on a gridview row
    based on some criterias.

    The code works great, but my problem is that my selectedrowstyle doesn't
    work anymore.
    I set my gridview properties to selectedrowstyle->cssclass->gridselecteditem

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.GridViewRowEventArgs) Handles
    GridView1.RowDataBound
    If e.Row.RowType = DataControlRowType.DataRow Then
    Dim fd As dataSet.fdRow = CType(CType(e.Row.DataItem,
    Data.DataRowView).Row, DataSet.fdRow)
    If fd IsNot Nothing Then
    If Not fd.IsapprDtNull Or Not fd.IsapprDtNull() Then
    e.Row.CssClass = "highlightClosed"
    End If
    End If
    End If
    End Sub

    How can I get around this

    Thanks
    Peter
     
    Peter, May 10, 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. =?Utf-8?B?ZGFuYw==?=

    GridView RowDataBound not called after postback

    =?Utf-8?B?ZGFuYw==?=, Feb 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    9,045
    amiguyus
    Dec 14, 2010
  2. tfsmag
    Replies:
    0
    Views:
    1,646
    tfsmag
    May 8, 2006
  3. K B
    Replies:
    2
    Views:
    5,757
    Jan Hyde
    Jun 1, 2006
  4. Replies:
    0
    Views:
    2,564
  5. jobs
    Replies:
    1
    Views:
    2,662
  6. Tim
    Replies:
    2
    Views:
    1,121
  7. david
    Replies:
    3
    Views:
    986
    Lloyd Sheen
    Jul 26, 2008
  8. Sunny
    Replies:
    0
    Views:
    325
    Sunny
    Jul 13, 2006
Loading...