We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

alternate item color in GridControl and GridDataBoundGrid

hi to all, how can i alternate automatically item color in GridControl and GridDataBoundGrid best regards and thanks in advance fady

2 Replies

AD Administrator Syncfusion Team April 25, 2006 08:50 AM UTC

Hi Fady, You need to handle the Grid''s PrepareviewstyleInfo event for coloring the row in a grid.Here is a code snippet. if(e.RowIndex > 0 && e.ColIndex > 0) { if(e.RowIndex %2 == 0) { e.Style.BackColor = Color.PaleGreen; } else { e.Style.BackColor = Color.BurlyWood; } } Please let me know if you need any further assistance. Thank you for choosing Syncfusion Essential Studio. Regards, Haneef


FS Fady Sayegh April 25, 2006 09:11 AM UTC

Hi Haneef, thanks to your reply, it works fady

Loader.
Live Chat Icon For mobile
Up arrow icon