# FarPoint.Win.Spread.SheetView.SortColumns

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Spread_SheetView_SortColumns_" data-uid="FarPoint.Win.Spread.SheetView.SortColumns*">SortColumns Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Spread_SheetView_SortColumns_" data-uid="FarPoint.Win.Spread.SheetView.SortColumns*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_SortColumns_System_Int32_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.SortColumns(System.Int32,System.Boolean)">SortColumns(int, bool)</h4>
<div class="markdown level1 summary"><p>Sorts all the columns on the sheet by the specified row.</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>Index of the row to use as a key to 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 to sort in ascending order</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 if successful; false otherwise</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_SortColumns_" data-uid="FarPoint.Win.Spread.SheetView.SortColumns*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_SortColumns_System_Int32_System_Boolean_System_Collections_IComparer_" data-uid="FarPoint.Win.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 on the sheet by the specified row using the specified comparison.</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>Index of the row to use as a key to 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 to sort in ascending order</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><p>true if successful; false otherwise</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_SortColumns_" data-uid="FarPoint.Win.Spread.SheetView.SortColumns*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_SortColumns_System_Int32_System_Int32_FarPoint_Win_Spread_SortInfo___" data-uid="FarPoint.Win.Spread.SheetView.SortColumns(System.Int32,System.Int32,FarPoint.Win.Spread.SortInfo[])">SortColumns(int, int, SortInfo[])</h4>
<div class="markdown level1 summary"><p>Sorts a specified range of columns on the sheet by the specified sort information.</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>Index of first column to start sorting</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 range to sort</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.Spread.SortInfo.html">SortInfo</a>[]</td>
      <td><span class="parametername">sortInfo</span></td>
      <td><p>Array of SortInfo objects with the row indexes and sort order</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 if successful; false otherwise</p>
</td>
    </tr>
  </tbody>
</table>
</div>
