# FarPoint.Web.Spread.SheetView.SortRows

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Web_Spread_SheetView_SortRows_" data-uid="FarPoint.Web.Spread.SheetView.SortRows*">SortRows Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Web_Spread_SheetView_SortRows_" data-uid="FarPoint.Web.Spread.SheetView.SortRows*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_SortRows_System_Int32_System_Boolean_System_Boolean_" data-uid="FarPoint.Web.Spread.SheetView.SortRows(System.Int32,System.Boolean,System.Boolean)">SortRows(int, bool, bool)</h4>
<div class="markdown level1 summary"><p>Sorts all the rows in the sheet according to the specified parameters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool SortRows(int keyColumn, bool ascending, bool showIndicator)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SortRows(keyColumn As Integer, ascending As Boolean, showIndicator As Boolean) 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.int32">int</a></td>
      <td><span class="parametername">keyColumn</span></td>
      <td><p>Column whose values are compared during sorting</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ascending</span></td>
      <td><p>Whether the sort is ascending</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">showIndicator</span></td>
      <td><p>Whether to display the sort indicator</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_SheetView_SortRows_" data-uid="FarPoint.Web.Spread.SheetView.SortRows*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_SortRows_System_Int32_System_Boolean_System_Boolean_System_Collections_IComparer_" data-uid="FarPoint.Web.Spread.SheetView.SortRows(System.Int32,System.Boolean,System.Boolean,System.Collections.IComparer)">SortRows(int, bool, bool, IComparer)</h4>
<div class="markdown level1 summary"><p>Sorts all the rows in the sheet according to the specified parameters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool SortRows(int keyColumn, bool ascending, bool showIndicator, IComparer comparer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SortRows(keyColumn As Integer, ascending As Boolean, showIndicator As Boolean, comparer As IComparer) 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.int32">int</a></td>
      <td><span class="parametername">keyColumn</span></td>
      <td><p>Column whose values are compared during sorting</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ascending</span></td>
      <td><p>Whether the sort is ascending</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">showIndicator</span></td>
      <td><p>Whether to display the sort indicator</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icomparer">IComparer</a></td>
      <td><span class="parametername">comparer</span></td>
      <td><p>IComparer object used to compare the values</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_SheetView_SortRows_" data-uid="FarPoint.Web.Spread.SheetView.SortRows*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_SortRows_System_Int32_System_Int32_FarPoint_Web_Spread_SortInfo___" data-uid="FarPoint.Web.Spread.SheetView.SortRows(System.Int32,System.Int32,FarPoint.Web.Spread.SortInfo[])">SortRows(int, int, SortInfo[])</h4>
<div class="markdown level1 summary"><p>Sorts a range of rows in the sheet according to the specified parameters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool SortRows(int row, int rowCount, SortInfo[] sortInfo)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SortRows(row As Integer, rowCount As Integer, sortInfo As SortInfo()) 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.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>Starting row index (the start of the range of rows to sort)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rowCount</span></td>
      <td><p>Number of rows in the range to sort</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Web.Spread.SortInfo.html">SortInfo</a>[]</td>
      <td><span class="parametername">sortInfo</span></td>
      <td><p>Array of SortInfo objects that contain the column indexes and the order of sorting</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></td>
    </tr>
  </tbody>
</table>
</div>
