[]
        
(Showing Draft Content)

C1.WPF.FlexGrid.RowCol.CellStyle

CellStyle Property

CellStyle

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

Declaration
public CellStyle 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:

<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>