# C1.WPF.FlexGrid.CellRange.Cells

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_FlexGrid_CellRange_Cells_" data-uid="C1.WPF.FlexGrid.CellRange.Cells*">Cells Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_FlexGrid_CellRange_Cells_" data-uid="C1.WPF.FlexGrid.CellRange.Cells*"></a>
<h4 id="C1_WPF_FlexGrid_CellRange_Cells" data-uid="C1.WPF.FlexGrid.CellRange.Cells">Cells</h4>
<div class="markdown level1 summary"><p>Gets an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a> that can be used to
iterate over the cells in this <a class="xref" href="C1.WPF.FlexGrid.CellRange.html">CellRange</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IEnumerable&lt;CellRange&gt; Cells { get; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public ReadOnly Property Cells As IEnumerable(Of CellRange)</code></pre>
</div>
<h5 id="C1_WPF_FlexGrid_CellRange_Cells_examples">Examples</h5>
<p>The code below shows how you can use the <b>Cells</b> property to add
all integer values in a given cell range.</p>
<pre><code class="lang-csharp">var total = 0;
foreach (var cell in rng.Cells)
{
  var value = grid[cell.Row, cell.Column];
  if (value is int)
  {
    total += (int)value;
  }
}</code></pre>

</div>
