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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Set the horizontal alignment on summary columns?

Platform: WPF |
Control: SfDataGrid |
.NET Framework: 4.5

The appearance of Summary cells (Table summary, Group summary and Caption summary) are customized by writing styles for those cells. SfDataGrid exposes the properties TableSummaryCellStyle, GroupSummaryCellStyle, CaptionSummaryCellStyle that customizes the appearance of the cell. Also SfDataGrid exposes the following properties to customize the appearance of summary cells conditionally.




Used to customize the alignment of Table Summary cell


Used to customize the alignment of Group Summary cell.


Used to customize the alignment of Caption Summary cell.


Now you can learn how to change the horizontal alignment of summary cells for a particular columns only using StyleSelector properties exposed in SfDataGrid. Create a class deriving from StyleSelector and override SelectStyle method (When WinRT overrides SelectStyleCore method) and return styles based on condition. In the SelectStyle override method, you can access the Cell (for eg: GridTableSummaryCell) and from cell you can get the column details and customize the alignment based on column names. Refer the following code example.



The following TableSummaryStyle1 and TableSummaryStyle2 styles are returned to the Table Summary Cells based on the column name. Refer the following code example.



The following TableSummaryCellStyleSelector property is used to customize the horizontal alignment of table summary cells. Refer the following code example.



Note: Group Summary cell and Caption Summary cell horizontal alignment are customized like the horizontal alignment customization of Table Summary Cell


Refer the following screenshot for horizontal alignment of table summary cell customization.


In the above screenshot, horizontal alignment is set as center for Sales in Quarter1, Sales in Quarter2 table summary cells and right for other table summary cells.

Sample Links:





2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile