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.
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.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:|
or the page will be automatically redirected to sign-in page in 10 seconds.