This is a migrated thread and some comments may be shown as answers.

Grand Total row formatting

2 Answers 127 Views
GridView
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 21 Aug 2015, 03:32 PM

On my grid I am grouping by one field, and have gridview1.mastertemplate.ShowTotals = True so that I can show a grand total for columns when that grid is grouped.  My issue is that I need to change the appearance of the grand total row differently than the other (group) summary rows in ViewCellFormatting.  Is this possible, and if so how can I do it?

 

Thanks

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Aug 2015, 09:52 AM
Hello Jim,

Thank you for writing.

In my the total summary rows did not have their Group property set, so you can try identifying them with this. Here is a sample:
private void RadGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.CellElement is GridSummaryCellElement && e.Row.Group == null)
    {
        e.CellElement.DrawFill = true;
        e.CellElement.BackColor = Color.Red;
        e.CellElement.GradientStyle = GradientStyles.Solid;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
    }
}

Let me know how this works for you.

Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
William
Top achievements
Rank 1
answered on 03 Sep 2015, 07:55 PM
Perfect.  Thanks!
Tags
GridView
Asked by
William
Top achievements
Rank 1
Answers by
Stefan
Telerik team
William
Top achievements
Rank 1
Share this question
or