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

Color change for the background per row

Thread ID:





121039 Nov 5,2015 07:34 AM UTC Nov 9,2015 12:48 PM UTC WinForms 1
Tags: GridGroupingControl
Pierre Smith
Asked On November 5, 2015 07:34 AM UTC


I need to be able to set the background color for a entire row
I want the user to be able to click on a specific line and then press a button to change the color to something else
i also want to be able to iterate throught the data and check things like duplicate data and make those lines a different color

Can someone help me with that please
thank you

Adhikesevan Kothandaraman [Syncfusion]
Replied On November 9, 2015 12:48 PM UTC

Hi Pierre,

Thanks for contacting Syncfusion Support.

If you want to change the back color of the record while clicking the button, it can be done by using the following customization,

Code Snippet:

//To set the back colors for the records

this.gridGroupingControl1.QueryCellStyleInfo += gridGroupingControl1_QueryCellStyleInfo;

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)


     if(e.TableCellIdentity.RowIndex == row && highlight)


         e.Style.BackColor = Color.Green;




         //Set the color for Duplicate values

         e.Style.BackColor = Color.LightGreen;



 int row, col;

 int[] rowCollection = new int[10];

 bool highlight = false;

 private void button1_Click(object sender, EventArgs e)


     highlight = true;

     row = this.gridGroupingControl1.TableControl.CurrentCell.RowIndex;

     //For validating the data

     string data = this.gridGroupingControl1.Table.CurrentRecord.GetValue("No").ToString();


     foreach(Record rec in this.gridGroupingControl1.Table.Records)


         int i=0;

         if(rec.GetValue("No").ToString() == data && rec.GetRowIndex() != row)


             rowCollection[i] = rec.GetRowIndex();





Sample: http://www.syncfusion.com/downloads/support/forum/121039/ze/SelectionColor-GG-294462146



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