This topic has not yet been rated - Rate this topic

DataGrid.CellStyle Property

Gets or sets the style that is used when rendering the data grid cells.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)
public Style CellStyle { get; set; }
<sdk:DataGrid>
  <sdk:DataGrid.CellStyle>
    inlineStyle
  </sdk:DataGrid.CellStyle>
</sdk:DataGrid>
<sdk:DataGrid CellStyle="styleReference"/>

XAML Values

inlineStyle

A single Style object element.

styleReference

A StaticResource Markup Extension reference to a Style.

Property Value

Type: System.Windows.Style
The style applied to cells. The default is null.

Dependency property identifier field: CellStyleProperty

Whether defined as an inline style or as a resource, the Style defines the appearance of cells in the data grid, and should specify a TargetType of DataGridCell. You typically specify setters for individual properties, and might also use a setter for the Template property if you wanted to change the composition of elements. For information that can help you decide whether to define styles inline or as resources, see Inline Styles and Templates.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ