# FarPoint.Web.Spread.SheetView.SortColumns

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Web_Spread_SheetView_SortColumns_" data-uid="FarPoint.Web.Spread.SheetView.SortColumns*">SortColumns Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Web_Spread_SheetView_SortColumns_" data-uid="FarPoint.Web.Spread.SheetView.SortColumns*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_SortColumns_System_Int32_System_Boolean_" data-uid="FarPoint.Web.Spread.SheetView.SortColumns(System.Int32,System.Boolean)">SortColumns(int, bool)</h4>
<div class="markdown level1 summary"><p>Sorts all the columns 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 SortColumns(int keyRow, bool ascending)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SortColumns(keyRow As Integer, ascending 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">keyRow</span></td>
      <td><p>Row 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>
  </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_SortColumns_" data-uid="FarPoint.Web.Spread.SheetView.SortColumns*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_SortColumns_System_Int32_System_Boolean_System_Collections_IComparer_" data-uid="FarPoint.Web.Spread.SheetView.SortColumns(System.Int32,System.Boolean,System.Collections.IComparer)">SortColumns(int, bool, IComparer)</h4>
<div class="markdown level1 summary"><p>Sorts all the columns 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 SortColumns(int keyRow, bool ascending, IComparer comparer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SortColumns(keyRow As Integer, ascending 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">keyRow</span></td>
      <td><p>Row 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.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_SortColumns_" data-uid="FarPoint.Web.Spread.SheetView.SortColumns*"></a>
<h4 id="FarPoint_Web_Spread_SheetView_SortColumns_System_Int32_System_Int32_FarPoint_Web_Spread_SortInfo___" data-uid="FarPoint.Web.Spread.SheetView.SortColumns(System.Int32,System.Int32,FarPoint.Web.Spread.SortInfo[])">SortColumns(int, int, SortInfo[])</h4>
<div class="markdown level1 summary"><p>Sorts a range of columns 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 SortColumns(int column, int columnCount, SortInfo[] sortInfo)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SortColumns(column As Integer, columnCount 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">column</span></td>
      <td><p>Starting column index (the start of the range of columns 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 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 row 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>
