# C1.Win.RulesManager.Model.ItemRangeCollection.SetRange

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_RulesManager_Model_ItemRangeCollection_SetRange_" data-uid="C1.Win.RulesManager.Model.ItemRangeCollection.SetRange*">SetRange Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_RulesManager_Model_ItemRangeCollection_SetRange_" data-uid="C1.Win.RulesManager.Model.ItemRangeCollection.SetRange*"></a>
<h4 id="C1_Win_RulesManager_Model_ItemRangeCollection_SetRange_System_String_" data-uid="C1.Win.RulesManager.Model.ItemRangeCollection.SetRange(System.String)">SetRange(string)</h4>
<div class="markdown level1 summary"><p>Tries to parse text into the IItemRange object or list of objects and fill out 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 bool SetRange(string text)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SetRange(text As String) As Boolean</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.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>text to parse</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.boolean">bool</a></td>
      <td><p>True of success.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Win.RulesManager.Model.IItemRangeCollection.SetRange.html#C1_Win_RulesManager_Model_IItemRangeCollection_SetRange_System_String_">IItemRangeCollection.SetRange(string)</a></div>
<h5 id="C1_Win_RulesManager_Model_ItemRangeCollection_SetRange_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The separator for the ranges is ';'.</p>
</div>
<h5 id="C1_Win_RulesManager_Model_ItemRangeCollection_SetRange_System_String__examples">Examples</h5>
<p>collection.SetRange(&quot;1:7;[Field1];5:6:[Field2]&quot;);
Fills collection with 3 ranges:
<a class="xref" href="C1.Win.RulesManager.ItemRange.html">ItemRange</a> with FirstItem = 1 and LastItem = 7,
<a class="xref" href="C1.Win.RulesManager.FieldRange.html">FieldRange</a> with 1 field: Field1,
<a class="xref" href="C1.Win.RulesManager.CustomItemRange.html">CustomItemRange</a> with FirstItem = 5, LastItem = 6 and 1 field: Field2.</p>

</div>
