≺ back to sample list
styling icon
Styling
Provide your own styles to obtain the look you want and need. This sample gives you some insight on how to proceed.
What is shown in this sample:

Shows how to change the style of the elements that compose the DataGrid through the use of styleDefinitions and a styleSelector in code behind, rather then through css files.

The dataCell, columnHeaderRow, groupByPanel, and groupByPanelElement elements are targeted through styleDefinitions that apply to all corresponding elements.

The dataCell and dataRow elements are targeted through a custom styleSelector, which applies a style based on specific values. In this example, all dataRows for which the employee is "Anne Dodsworth", and all dataCells in the Stock Level column which have a value of 25% or less, are given a different background and foreground color.