# C1.Win.FlexGrid.CellRange.StyleNew

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_CellRange_StyleNew_" data-uid="C1.Win.FlexGrid.CellRange.StyleNew*">StyleNew Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_CellRange_StyleNew_" data-uid="C1.Win.FlexGrid.CellRange.StyleNew*"></a>
<h4 id="C1_Win_FlexGrid_CellRange_StyleNew" data-uid="C1.Win.FlexGrid.CellRange.StyleNew">StyleNew</h4>
<div class="markdown level1 summary"><p>Gets or sets the style used to display every cell in the range, creating a new style if necessary.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public CellStyle StyleNew { get; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public ReadOnly Property StyleNew As CellStyle</code></pre>
</div>
<h5 id="C1_Win_FlexGrid_CellRange_StyleNew_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This property never returns null. If the range does not have a style assigned to it, a new style
will be created automatically.</p>
</div>
<h5 id="C1_Win_FlexGrid_CellRange_StyleNew_examples">Examples</h5>
<p>The code below creates a <a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> structure and uses it to apply a custom style to
the entire range.</p>
<pre><code class="lang-csharp">// create a cell range
CellRange rg = _flex.GetCellRange(1, 1, 5, 5);

// make sure range is red
rg.StyleNew.BackColor = Color.Red;</code></pre>

</div>
