# C1.Win.FlexGrid.CellRangeCollection.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_CellRangeCollection_Add_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_CellRangeCollection_Add_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add*"></a>
<h4 id="C1_Win_FlexGrid_CellRangeCollection_Add_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add(System.Int32,System.Int32,System.Int32,System.Int32)">Add(int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> object to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int Add(int topRow, int leftCol, int bottomRow, int rightCol)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer) As Integer</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.int32">int</a></td>
      <td><span class="parametername">topRow</span></td>
      <td><p>Top row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">leftCol</span></td>
      <td><p>Left column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bottomRow</span></td>
      <td><p>Bottom row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rightCol</span></td>
      <td><p>Right column in the range.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The index of the object in the collection.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_CellRangeCollection_Add_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add*"></a>
<h4 id="C1_Win_FlexGrid_CellRangeCollection_Add_C1_Win_FlexGrid_CellRange_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add(C1.Win.FlexGrid.CellRange)">Add(CellRange)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> object to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int Add(CellRange value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(value As CellRange) As Integer</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="C1.Win.FlexGrid.CellRange.html">CellRange</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>Object to add to the collection.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The index of the object in the collection.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_CellRangeCollection_Add_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add*"></a>
<h4 id="C1_Win_FlexGrid_CellRangeCollection_Add_System_Int32_System_Int32_System_Int32_System_Int32_System_Boolean_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add(System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean)">Add(int, int, int, int, bool)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> object to the collection, optionally
removing other overlapping ranges from the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int Add(int topRow, int leftCol, int bottomRow, int rightCol, bool clearOverlappingRanges)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer, clearOverlappingRanges As Boolean) As Integer</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.int32">int</a></td>
      <td><span class="parametername">topRow</span></td>
      <td><p>Top row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">leftCol</span></td>
      <td><p>Left column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bottomRow</span></td>
      <td><p>Bottom row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rightCol</span></td>
      <td><p>Right column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">clearOverlappingRanges</span></td>
      <td><p>Whether to remove overlapping
ranges from the collection before adding the new range.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The index of the object in the collection.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_CellRangeCollection_Add_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add*"></a>
<h4 id="C1_Win_FlexGrid_CellRangeCollection_Add_C1_Win_FlexGrid_CellRange_System_Boolean_" data-uid="C1.Win.FlexGrid.CellRangeCollection.Add(C1.Win.FlexGrid.CellRange,System.Boolean)">Add(CellRange, bool)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> object to the collection, optionally
removing other overlapping ranges from the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int Add(CellRange value, bool clearOverlappingRanges)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(value As CellRange, clearOverlappingRanges As Boolean) As Integer</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="C1.Win.FlexGrid.CellRange.html">CellRange</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>Object to add to the collection.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">clearOverlappingRanges</span></td>
      <td><p>Whether to remove overlapping
ranges from the collection before adding the new range.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The index of the object in the collection.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
