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
close icon

how to set GridGroupingControl

to set GridGroupingContol:
1. the GridGroupintConrol have only one table ,i want to make some cells can use and to make other cells cannot use,?
2,how to set some cells of colour,size ,font,text?

thank you!

3 Replies

RC Rajadurai C Syncfusion Team April 7, 2010 12:52 PM UTC

Hi,

Thanks for your interest in Syncfusion Products.

To handle styles for individual cells in GridGroupingControl, you can make use of GridStyleInfo properties in QueryCellStyleInfo/PrepareViewStyleInfo event. Following is the code handled in QueryCellStyleInfo event to achieve the same.

if (e.TableCellIdentity.TableCellType == Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.AlternateRecordFieldCell)
{
Record rec = e.TableCellIdentity.DisplayElement.GetRecord();
if (e.Style.Text.Contains("2"))
e.Style.BackColor = Color.Red;
if (rec.GetSourceIndex() == 4)
e.Style.Font.Bold = true;
if (e.TableCellIdentity.Column.Name == "Department")
e.Style.ReadOnly = true; //e.Style.Enabled = true;
}

Sample:
http://help.syncfusion.com/support/samples/Grid.Windows/8.1.0.30/F93830.zip

Regards,
Rajadurai


ZH zhheng April 8, 2010 01:47 AM UTC

thank you very much!


RC Rajadurai C Syncfusion Team April 8, 2010 03:38 AM UTC

Hi,

Thanks for your update.

Regards,
Rajadurai

Loader.
Live Chat Icon For mobile
Up arrow icon