Category / Section
How to align the summary cells in the WinForms GridGroupingControl?
1 min read
Summary cell alignment
By default, the horizontal alignment of the summary cells is left. However, you can align the summary cells by setting the HorizontalAlignment property to Right. You can refer to the following code example for using the HorizontalAlignment property.
C#
GridSummaryColumnDescriptor sumCol1 = new GridSummaryColumnDescriptor("sumCol1", SummaryType.DoubleAggregate, "Value2", "{Sum}"); GridSummaryRowDescriptor srd = new GridSummaryRowDescriptor("Sum", "Total", sumCol1); srd.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Right;
VB
Dim sumCol1 As New GridSummaryColumnDescriptor("Sum", SummaryType.DoubleAggregate, " Value2", "{Sum:#}") Dim srd As New GridSummaryRowDescriptor("Sum", "Total", sumCol1) srd.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Right
In the following screenshot, summary cell is right aligned.
Samples: