# C1.WPF.FlexGrid.C1FlexSheet.SetCellFormat

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_FlexGrid_C1FlexSheet_SetCellFormat_" data-uid="C1.WPF.FlexGrid.C1FlexSheet.SetCellFormat*">SetCellFormat Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_FlexGrid_C1FlexSheet_SetCellFormat_" data-uid="C1.WPF.FlexGrid.C1FlexSheet.SetCellFormat*"></a>
<h4 id="C1_WPF_FlexGrid_C1FlexSheet_SetCellFormat_System_Collections_Generic_IEnumerable_C1_WPF_FlexGrid_CellRange__C1_WPF_FlexGrid_CellFormat_System_Object_" data-uid="C1.WPF.FlexGrid.C1FlexSheet.SetCellFormat(System.Collections.Generic.IEnumerable{C1.WPF.FlexGrid.CellRange},C1.WPF.FlexGrid.CellFormat,System.Object)">SetCellFormat(IEnumerable&lt;CellRange&gt;, CellFormat, object)</h4>
<div class="markdown level1 summary"><p>Set format for cell.
eg:SetCellFormat(flex.Selection.Cells, C1.WPF.FlexSheet.CellFormat.Background, new SolidColorBrush(Colors.Red));</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetCellFormat(IEnumerable&lt;CellRange&gt; cells, CellFormat format, object value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetCellFormat(cells As IEnumerable(Of CellRange), format As CellFormat, value As Object)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="../C1.WPF.FlexGrid.4.6.2/C1.WPF.FlexGrid.CellRange.html">CellRange</a>&gt;</td>
      <td><span class="parametername">cells</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.FlexGrid.CellFormat.html">CellFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
