Home › Forums › WinForms controls › Xceed Grid for WinForms › Changing Background Color of Row according to data on initial Form Load.
I have a Windows Form containing a Grid Control which displays a simple list of values from DB.
I would like to change the background color of the row according to the value of data retrieved from DB on initial load of the form.
ex: if value of column is YES the row should be gray in color.
Any help would be appreciated.
Imported from legacy forums. Posted by Ravs (had 562 views)
Use the AddingDataRow event, and set the color accordingly in the event handler.
private void Form1_Load(object sender, EventArgs e)
void gridControl1_AddingDataRow( object sender, AddingDataRowEventArgs e )
if( ( int )e.DataRow.Cells[ “ShipperID” ].Value == 2 )
Imported from legacy forums. Posted by André (had 366 views)
Thanks a lot!
Imported from legacy forums. Posted by Ravs (had 939 views)