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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Set the horizontal alignment on summary columns?

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:





Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
2485 08/12/2014 01/25/2016 WPF SfDataGrid 4.5
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

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

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