# FarPoint.Web.Spread.SheetView.Sort

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Web_Spread_SheetView_Sort_" data-uid="FarPoint.Web.Spread.SheetView.Sort*">Sort Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Web_Spread_SheetView_Sort_" data-uid="FarPoint.Web.Spread.SheetView.Sort*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_Sort_System_Int32_System_Int32_System_Int32_System_Int32_System_Boolean_FarPoint_Web_Spread_SortInfo___" data-uid="FarPoint.Web.Spread.SheetView.Sort(System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,FarPoint.Web.Spread.SortInfo[])">Sort(int, int, int, int, bool, SortInfo[])</h4>
<div class="markdown level1 summary"><p>Sorts a range of cells in the data model.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool Sort(int row, int column, int rowCount, int columnCount, bool byRows, SortInfo[] sortInfo)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Sort(row As Integer, column As Integer, rowCount As Integer, columnCount As Integer, byRows As Boolean, 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 sheet row index</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">column</span></td>
      <td><p>Starting sheet column index</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 sheet 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">columnCount</span></td>
      <td><p>Number of columns in the sheet to sort</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">byRows</span></td>
      <td><p>Whether the sort should move rows in the range (true) or columns
in the range (false)</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 containing the column indexes (if byRows
is true) or row indexes (if byRows is false) 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>
