AD
Administrator
Syncfusion Team
April 1, 2008 10:48 PM UTC
HiDon,
Thank you for your interest in Syncfusion products.
You need to handle PrepareViewStyleInfo event to set the style of the row in a GridControl. Please refer the below sample code for more details.
void gridControl1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if (e.RowIndex > 2 && e.RowIndex < 5)
{
e.Style.BackColor = Color.Cornsilk;
}
else if (e.RowIndex > 5 && e.RowIndex < 10)
{
e.Style.BackColor = Color.Gold;
}
}
Please let me know if this helps.
Best Regards,
Srirajan
DO
Don
April 2, 2008 10:12 AM UTC
Ah, that should do it. I was messing around with the PrepareViewStyleInfo event, but I was always getting stack overflows because I was setting the style property of the grid directly instead of using the Style member of the 'e' parameter. Silly me.