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

row colors

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shaza
Top achievements
Rank 1
Shaza asked on 20 Aug 2011, 09:54 PM
Hey,
I need to change the color of the rows in the grId how can I do that?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Aug 2011, 04:50 AM
Hello Shaza,


Try the following code snippet to achieve your scenario.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem)
  {
     GridDataItem item = (GridDataItem)e.Item;
     if (e.Item.ItemType == GridItemType.Item)
     {
         item.BackColor = System.Drawing.Color.Red;
     }
  }
}

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