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

How can I change background color of the clicked row

Thread ID:





60105 Apr 27,2007 11:07 AM UTC Jun 27,2008 10:34 AM UTC WinForms 3
Tags: Grouping
Jiri Ludvik
Asked On April 27, 2007 11:07 AM UTC

I need to change background color of entire row in GridGroupingControl when user clicks on any cell in that row.

Tried to do that in TableControlCellClick event, but have no idea how to do that... :(

haneefm [Syncfusion]
Replied On April 27, 2007 09:08 PM UTC

Hi Jiri,

You can try this code.

gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.One;
gridGroupingControl1.TableOptions.SelectionBackColor = Color.Red;

Best regards,

Karsten Brocksieper
Replied On June 26, 2008 09:52 AM UTC


this works really good.

I have one more question regarding this issue. With this code the clicked row change the backcolor --- but not the clicked cell. The backcolor of the clicked cell don´t change.
Is it possible to change the color of the clicked cell too?


Jisha Joy [Syncfusion]
Replied On June 27, 2008 10:34 AM UTC

Hi Karsten,

This can be achieved by handling the QueryCellStyleInfo event. Please refer the code:

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (e.TableCellIdentity.RowIndex == cc.RowIndex && e.TableCellIdentity.ColIndex == cc.ColIndex)

e.Style.BackColor = this.gridGroupingControl1.TableOptions.SelectionBackColor;
this.gridGroupingControl1.TableControl.RefreshRange(GridRangeInfo.Cell(cc.RowIndex, cc.ColIndex));




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