# GrapeCity.Documents.Excel.IRange.AutoFilter

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IRange_AutoFilter_" data-uid="GrapeCity.Documents.Excel.IRange.AutoFilter*">AutoFilter Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IRange_AutoFilter_" data-uid="GrapeCity.Documents.Excel.IRange.AutoFilter*"></a>
<h4 id="GrapeCity_Documents_Excel_IRange_AutoFilter_System_Boolean_System_Int32_System_Object_GrapeCity_Documents_Excel_AutoFilterOperator_System_Object_System_Boolean_" data-uid="GrapeCity.Documents.Excel.IRange.AutoFilter(System.Boolean,System.Int32,System.Object,GrapeCity.Documents.Excel.AutoFilterOperator,System.Object,System.Boolean)">AutoFilter(bool, int, object, AutoFilterOperator, object, bool)</h4>
<div class="markdown level1 summary"><p>Filters a list using the AutoFilter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void AutoFilter(bool isFirstRowData, int field = 0, object criteria1 = null, AutoFilterOperator op = AutoFilterOperator.And, object criteria2 = null, bool visibleDropDown = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub AutoFilter(isFirstRowData As Boolean, Optional field As Integer = 0, Optional criteria1 As Object = Nothing, Optional op As AutoFilterOperator = AutoFilterOperator.And, Optional criteria2 As Object = Nothing, Optional visibleDropDown As Boolean = True)</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.boolean">bool</a></td>
      <td><span class="parametername">isFirstRowData</span></td>
      <td><p>Indicates whether the first row of the selection area participates in filtering.
When set to true, the behavior is consistent with SpreadJS;
when false, it is consistent with Microsoft Excel.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">field</span></td>
      <td><p>Optional Object. The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field zero).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">criteria1</span></td>
      <td><p>Optional Object. The criteria (a string; for example, &quot;101&quot;). Use &quot;=&quot; to find blank fields, or use &quot;&lt;&gt;&quot; to find nonblank fields. If this argument
is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, &quot;10&quot;).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.AutoFilterOperator.html">AutoFilterOperator</a></td>
      <td><span class="parametername">op</span></td>
      <td><p>Optional AutoFilterOperator.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">criteria2</span></td>
      <td><p>Optional Object. The second criteria (a string). Used with Criteria1 and Operator to construct compound criteria.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">visibleDropDown</span></td>
      <td><p>Optional Object. True to display the AutoFilter drop-down arrow for the filtered field; False to hide the AutoFilter drop-down arrow for the filtered field. True by default.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Excel_IRange_AutoFilter_" data-uid="GrapeCity.Documents.Excel.IRange.AutoFilter*"></a>
<h4 id="GrapeCity_Documents_Excel_IRange_AutoFilter_System_Int32_System_Object_GrapeCity_Documents_Excel_AutoFilterOperator_System_Object_System_Boolean_" data-uid="GrapeCity.Documents.Excel.IRange.AutoFilter(System.Int32,System.Object,GrapeCity.Documents.Excel.AutoFilterOperator,System.Object,System.Boolean)">AutoFilter(int, object, AutoFilterOperator, object, bool)</h4>
<div class="markdown level1 summary"><p>Filters a list using the AutoFilter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void AutoFilter(int field = 0, object criteria1 = null, AutoFilterOperator op = AutoFilterOperator.And, object criteria2 = null, bool visibleDropDown = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub AutoFilter(Optional field As Integer = 0, Optional criteria1 As Object = Nothing, Optional op As AutoFilterOperator = AutoFilterOperator.And, Optional criteria2 As Object = Nothing, Optional visibleDropDown As Boolean = True)</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">field</span></td>
      <td><p>Optional Object. The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field zero).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">criteria1</span></td>
      <td><p>Optional Object. The criteria (a string; for example, &quot;101&quot;). Use &quot;=&quot; to find blank fields, or use &quot;&lt;&gt;&quot; to find nonblank fields. If this argument
is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, &quot;10&quot;).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.AutoFilterOperator.html">AutoFilterOperator</a></td>
      <td><span class="parametername">op</span></td>
      <td><p>Optional AutoFilterOperator.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">criteria2</span></td>
      <td><p>Optional Object. The second criteria (a string). Used with Criteria1 and Operator to construct compound criteria.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">visibleDropDown</span></td>
      <td><p>Optional Object. True to display the AutoFilter drop-down arrow for the filtered field; False to hide the AutoFilter drop-down arrow for the filtered field. True by default.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
