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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

alternate item color in GridControl and GridDataBoundGrid

Thread ID:





43511 Apr 25,2006 07:49 AM UTC Apr 25,2006 09:11 AM UTC WinForms 2
Tags: GridControl
Fady Sayegh
Asked On April 25, 2006 07:49 AM UTC

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

Administrator [Syncfusion]
Replied On 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

Fady Sayegh
Replied On April 25, 2006 09:11 AM UTC

Hi Haneef, thanks to your reply, it works fady


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon