# C1.WPF.FlexGrid.RowCol.CellStyle

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_FlexGrid_RowCol_CellStyle_" data-uid="C1.WPF.FlexGrid.RowCol.CellStyle*">CellStyle Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_FlexGrid_RowCol_CellStyle_" data-uid="C1.WPF.FlexGrid.RowCol.CellStyle*"></a>
<h4 id="C1_WPF_FlexGrid_RowCol_CellStyle" data-uid="C1.WPF.FlexGrid.RowCol.CellStyle">CellStyle</h4>
<div class="markdown level1 summary"><p>Gets or sets a <a class="xref" href="C1.WPF.FlexGrid.RowCol.CellStyle.html#C1_WPF_FlexGrid_RowCol_CellStyle">CellStyle</a> that defines the appearance of the cells
in this row or column.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public CellStyle CellStyle { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property CellStyle As CellStyle</code></pre>
</div>
<h5 id="C1_WPF_FlexGrid_RowCol_CellStyle_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This property allows you to define reusable styles for grid rows and columns.
You can easily create <a class="xref" href="C1.WPF.FlexGrid.RowCol.CellStyle.html#C1_WPF_FlexGrid_RowCol_CellStyle">CellStyle</a> objects in XAML or in code, and
then assign them to grid rows or columns.</p>
</div>
<h5 id="C1_WPF_FlexGrid_RowCol_CellStyle_examples">Examples</h5>
<p>The XAML snippet below defines two <a class="xref" href="C1.WPF.FlexGrid.RowCol.CellStyle.html#C1_WPF_FlexGrid_RowCol_CellStyle">CellStyle</a> objects
and applies them to a column:</p>
<pre><code class="lang-csharp">&lt;Grid.Resources&gt;
  &lt;c1:CellStyle x:Key="redStyle" 
    Background="Red" Foreground="White"
    FontWeight="Bold" HorizontalAlignment="Center" /&gt;
  &lt;c1:CellStyle x:Key="blueStyle" 
    Background="Blue" Foreground="White" FontStyle="Italic"
    HorizontalAlignment="Center" VerticalAlignment="Center" /&gt;
&lt;/Grid.Resources&gt;

&lt;c1:C1FlexGrid Name="_flex" &gt;
  &lt;c1:C1FlexGrid.Columns&gt;
    &lt;c1:Column 
      Header="Hello"
      HeaderCellStyle="{StaticResource redStyle}" 
      CellStyle="{StaticResource blueStyle}" /&gt;
   &lt;/c1:C1FlexGrid.Columns&gt;
   &lt;c1:C1FlexGrid.Rows&gt;
     &lt;c1:Row/&gt;
     &lt;c1:Row/&gt;
   &lt;/c1:C1FlexGrid.Rows&gt;
 &lt;/c1:C1FlexGrid&gt;</code></pre>

</div>
