Override grid header

6 posts, 0 answers
  1. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 01 May 2008 Link to this post

    I'm trying to override the grid header background color as well as the row selected color. I added this code:

    <style type="text/css">

    td.GridHeader_Web20 input

    {

    background:#133926;

    }

    .SelectedRow_Web20

    {

    background:#b7e2c6;

    }

    </style>

    I must be missng something. Can you help me out?

    Thanks,
    Susan

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 May 2008 Link to this post

    Hi Susan,

    Try setting the BackColor for the GridHeader in the code behind as shown below.

    CS:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridHeaderItem) 
            { 
                GridHeaderItem header = (GridHeaderItem)e.Item; 
                header.BackColor = System.Drawing.Color.Red; 
     
            } 
        } 

    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 02 May 2008 Link to this post

    I am using Prometheus. I don't seem to have a 'griditemeventargs' available. Am I doing something wrong???

    Thanks,
    Susan
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 May 2008 Link to this post

    Hi,

    Go through the following help document links.

    Conditional Formatting for rows/cells on ItemDataBound
    Customizing row appearance

    Princy.
  6. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 04 May 2008 Link to this post

    This is what I have. It is still not changing the background color of the grid header.

      Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)

        If (TypeOf (e.Item) Is Telerik.Web.UI.GridHeaderItem) Then
          e.Item.BackColor = system.Drawing.Color.Green
        End If

      End Sub


    Thanks,
    Susan
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 May 2008 Link to this post

    Hi Susan,

    Try setting the Grid Skin to None.

    ASPX:
     <rad:radgrid id="RadGrid1" runat="server"   Skin="None"  > 


    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017