# C1.Win.FlexGrid.Node.Sort

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_Node_Sort_" data-uid="C1.Win.FlexGrid.Node.Sort*">Sort Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_Node_Sort_" data-uid="C1.Win.FlexGrid.Node.Sort*"></a>
<h4 id="C1_Win_FlexGrid_Node_Sort_C1_Win_FlexGrid_SortFlags_System_Int32_System_Int32_" data-uid="C1.Win.FlexGrid.Node.Sort(C1.Win.FlexGrid.SortFlags,System.Int32,System.Int32)">Sort(SortFlags, int, int)</h4>
<div class="markdown level1 summary"><p>Sorts this node's child nodes in the specified order.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Sort(SortFlags order, int col1, int col2)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Sort(order As SortFlags, col1 As Integer, col2 As Integer)</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="C1.Win.FlexGrid.SortFlags.html">SortFlags</a></td>
      <td><span class="parametername">order</span></td>
      <td><p>One or more values from the <a class="xref" href="C1.Win.FlexGrid.SortFlags.html">SortFlags</a> enumeration that specify
the type of sorting to be applied (e.g. ascending, descending, case-sensitive, etc).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">col1</span></td>
      <td><p>Start of a 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">col2</span></td>
      <td><p>End of a range of columns to sort.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_Node_Sort_C1_Win_FlexGrid_SortFlags_System_Int32_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The grid recognizes two types of row: regular rows which contain data, and node rows which are used
to group data. This method only sorts the row nodes; it does not reorder the data rows within each node.</p>
<p>To sort the data rows, use the grid's <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Sort.html#C1_Win_FlexGrid_C1FlexGridBase_Sort_C1_Win_FlexGrid_SortFlags_System_Int32_">Sort(SortFlags, int)</a> method instead.</p>
</div>


<a id="C1_Win_FlexGrid_Node_Sort_" data-uid="C1.Win.FlexGrid.Node.Sort*"></a>
<h4 id="C1_Win_FlexGrid_Node_Sort_C1_Win_FlexGrid_SortFlags_" data-uid="C1.Win.FlexGrid.Node.Sort(C1.Win.FlexGrid.SortFlags)">Sort(SortFlags)</h4>
<div class="markdown level1 summary"><p>Sorts this node's child nodes in the specified order.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Sort(SortFlags order)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Sort(order As SortFlags)</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="C1.Win.FlexGrid.SortFlags.html">SortFlags</a></td>
      <td><span class="parametername">order</span></td>
      <td><p>One or more values from the <a class="xref" href="C1.Win.FlexGrid.SortFlags.html">SortFlags</a> enumeration that specify
the type of sorting to be applied (e.g. ascending, descending, case-sensitive, etc).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_Node_Sort_C1_Win_FlexGrid_SortFlags__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The grid recognizes two types of row: regular rows which contain data, and node rows which are used
to group data. This method only sorts the row nodes; it does not reorder the data rows within each node.</p>
<p>To sort the data rows, use the grid's <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Sort.html#C1_Win_FlexGrid_C1FlexGridBase_Sort_C1_Win_FlexGrid_SortFlags_System_Int32_">Sort(SortFlags, int)</a> method instead.</p>
</div>


<a id="C1_Win_FlexGrid_Node_Sort_" data-uid="C1.Win.FlexGrid.Node.Sort*"></a>
<h4 id="C1_Win_FlexGrid_Node_Sort_System_Collections_IComparer_" data-uid="C1.Win.FlexGrid.Node.Sort(System.Collections.IComparer)">Sort(IComparer)</h4>
<div class="markdown level1 summary"><p>Sorts this node's child nodes using a given <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icomparer">IComparer</a> object to determine the node order.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Sort(IComparer comparer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Sort(comparer As IComparer)</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.collections.icomparer">IComparer</a></td>
      <td><span class="parametername">comparer</span></td>
      <td><p>An object that implements the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icomparer">IComparer</a> interface used
to compare <a class="xref" href="C1.Win.FlexGrid.Node.Row.html#C1_Win_FlexGrid_Node_Row">Row</a> objects. This can be used to provide custom sorting.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_Node_Sort_System_Collections_IComparer__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The grid recognizes two types of row: regular rows which contain data, and node rows which are used
to group data. This method only sorts the row nodes; it does not reorder the data rows within each node.</p>
<p>To sort the data rows, use the grid's <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Sort.html#C1_Win_FlexGrid_C1FlexGridBase_Sort_C1_Win_FlexGrid_SortFlags_System_Int32_">Sort(SortFlags, int)</a> method instead.</p>
</div>
</div>
