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

Summary row title and backcolor problem

Hi,

I am facing a problem in GCC, assigning of caption i.e Title and backcolor to my summary rows.

I have created a summaryrowdescriptor object and set ChildGroupOptions and TopLevelGroupOptions showsummaries to true, which shows summary for each group and grand total of all groups.

Problem is i am not not able to set different backcolor for total and grandtotal row, also not able to set title as "Total" and "Grand Total" for those summary rows. It shows common color and title for all.

Any help would be higly appreciated.


Thanks,
Gomati


2 Replies

AD Administrator Syncfusion Team April 2, 2008 11:14 PM UTC

Hi Gomati,

Issue 1
<<<<<<<<<
To set Back color of all summary row you need to use below code snippet

this.gridGroupingControl1.TableDescriptor.Appearance.AnySummaryCell.BackColor = Color.Red;

//To set Back color of particular GroupSummary Row
this.gridGroupingControl1.TableDescriptor.Columns["Name"].GroupByAppearance.AnySummaryCell.BackColor = Color.LightBlue;

Issue 2
<<<<<<<<<<<
To set different Summary Title for each Groupsummary Row, you need to handle " e.Style.Text" property in QueryCellStyleInfo event. Below are the code

Element el = e.TableCellIdentity.DisplayElement;
if (e.TableCellIdentity.DisplayElement != null && e.TableCellIdentity.TableCellType != GridTableCellType.SummaryFieldCell &&
e.TableCellIdentity.TableCellType == GridTableCellType.SummaryTitleCell && el.ParentGroup.Name == "Name")
{
e.Style.Text = "Total";
}


Please refer the sample for implementation and let me know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/F72726/main.htm


Best regards,
Johnson








GO Gomati April 3, 2008 04:31 AM UTC

Hi Jhonson,

Thanks a lot for reply. It really helped me in my task completion.

Thanks,
Gomati

>Hi Gomati,

Issue 1
<<<<<<<<<
To set Back color of all summary row you need to use below code snippet

this.gridGroupingControl1.TableDescriptor.Appearance.AnySummaryCell.BackColor = Color.Red;

//To set Back color of particular GroupSummary Row
this.gridGroupingControl1.TableDescriptor.Columns["Name"].GroupByAppearance.AnySummaryCell.BackColor = Color.LightBlue;

Issue 2
<<<<<<<<<<<
To set different Summary Title for each Groupsummary Row, you need to handle " e.Style.Text" property in QueryCellStyleInfo event. Below are the code

Element el = e.TableCellIdentity.DisplayElement;
if (e.TableCellIdentity.DisplayElement != null && e.TableCellIdentity.TableCellType != GridTableCellType.SummaryFieldCell &&
e.TableCellIdentity.TableCellType == GridTableCellType.SummaryTitleCell && el.ParentGroup.Name == "Name")
{
e.Style.Text = "Total";
}


Please refer the sample for implementation and let me know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/F72726/main.htm


Best regards,
Johnson










Loader.
Live Chat Icon For mobile
Up arrow icon