Gets or sets a CellStyle that defines the appearance of the cells in this row or column.

Namespace:  C1.Silverlight.FlexGrid
Assembly:  C1.Silverlight.FlexGrid.4 (in C1.Silverlight.FlexGrid.4.dll)

Syntax

C#
public CellStyle CellStyle { get; set; }
Visual Basic
Public Property CellStyle As CellStyle
	Get
	Set

Remarks

This property allows you to define reusable styles for grid rows and columns. You can easily create CellStyle objects in XAML or in code, and then assign them to grid rows or columns.

Examples

The XAML snippet below defines two CellStyle objects and applies them to a column:
Copy CodeC#
<Grid.Resources>
  <c1:CellStyle x:Key="redStyle" 
    Background="Red" Foreground="White"
    FontWeight="Bold" HorizontalAlignment="Center" />
  <c1:CellStyle x:Key="blueStyle" 
    Background="Blue" Foreground="White" FontStyle="Italic"
    HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid.Resources>

<c1:C1FlexGrid Name="_flex" >
  <c1:C1FlexGrid.Columns>
    <c1:Column 
      Header="Hello"
      HeaderCellStyle="{StaticResource redStyle}" 
      CellStyle="{StaticResource blueStyle}" />
   </c1:C1FlexGrid.Columns>
   <c1:C1FlexGrid.Rows>
     <c1:Row/>
     <c1:Row/>
   </c1:C1FlexGrid.Rows>
 </c1:C1FlexGrid>

See Also