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

GGC selected row color

Hi,

Is there a way to change the color of row which is selected in the GGC.


2 Replies

SR Sri Rajan Syncfusion Team September 25, 2008 10:22 AM UTC

Hi Avi,

Thank you for your interest in Syncfusion products.

You need to handle TableControlPrepareViewStyleInfo event and set e.Inner.Style property to change the color of the row when it is selected. Here is the code.

void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (e.Inner.RowIndex == cc.RowIndex)
{
e.Inner.Style.BackColor = Color.Yellow;
}
else
{
e.Inner.Style.BackColor = Color.White;
}
}


Please let me know if this helps.

Best Regards,
Srirajan.



SR SubhaSheela R Syncfusion Team September 25, 2008 10:33 AM UTC

Hi Avi,

Thanks for your interest in Syncfusion product.

To change the color of selected cells or rows in GridGroupingControl, use the following code snippet:


this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.None;
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;
this.gridGroupingControl1.TableModel.Options.AlphaBlendSelectionColor = Color.Olive;


You can download the sample from the following page:

http://websamples.syncfusion.com/samples/Grid.Windows/I37014/main.htm'>http://websamples.syncfusion.com/samples/Grid.Windows/I37014/main.htm">http://websamples.syncfusion.com/samples/Grid.Windows/I37014/main.htm

Kindly let me know if you need any further assistance.

Regards,
Subhasheela R





Loader.
Live Chat Icon For mobile
Up arrow icon