Hi Vladimir,
Thank you for contacting Syncfusion support.
We have analyzed your query. If you set the HeaderStyle property in grid, style will be applied for all the column headers in the grid. So if you want to set the style for particular column only, you can use the HeaderStyle property in the GridColumn. And if you need to set the style for particular column, you can use the CellStyle property in grid column.
Please refer the below code snippet and sample in the following location:
Code Snippet:
Please refer the below code snippet for styling the HeaderCell and GridCell
<Page.Resources> <Style x:Key="headerstyle" TargetType="syncfusion:GridHeaderCellControl"> <Setter Property="Background" Value="Red" /> </Style> <Style x:Key="cellstyle" TargetType="syncfusion:GridCell"> <Setter Property="Background" Value="Red" /> </Style> </Page.Resources> |
Please refer the below code snippet for setting the style to the particular column.
<syncfusion:SfDataGrid.Columns> <syncfusion:GridTextColumn MappingName="ProductId" CellStyle="{StaticResource cellstyle}" HeaderStyle="{StaticResource headerstyle}"/> <syncfusion:GridTextColumn MappingName="ProductName"/> </syncfusion:SfDataGrid.Columns> |
UG Link: https://help.syncfusion.com/UG/winrt/default.htm#!Documents/stylingcells.htm
Regards,
Farjana Parveen A
Attachment:
SfDataGrid_Changing_Background_color_fa25e1c7.zip