This is a migrated thread and some comments may be shown as answers.

Item style skin dependant

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 07 Jan 2013, 06:27 PM

Hi there,

I am looking for a way to style the first column of my grid.
I want to have the backcolor of all the cells of the first column the same as the backcolor of the grid header depending of the skin used.

So if I use the skin 'Default' all the cells of the first column should have the backcolor of the grid header of the skin 'Default'.

Does anybody know how to do this?

Regards,

Marcel

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Jan 2013, 05:29 AM
Hi,

Try the following code.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridDataItem)
 {
          GridDataItem item = (GridDataItem)e.Item;
          item["CustomerID"].CssClass = "class1";
 }
}

CSS:
.class1
       {
           background-color:#333333 !important;
       }

Thanks,
Shinu.
Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or