# GrapeCity.Documents.Common.OwnedCollectionBase-1.Sort

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort*">Sort Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort*"></a>
<h4 id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_System_Comparison__0__" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort(System.Comparison{`0})">Sort(Comparison&lt;TItem&gt;)</h4>
<div class="markdown level1 summary"><p>Sorts the elements in the entire collection using the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.comparison-1">Comparison&lt;T&gt;</a>.</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(Comparison&lt;TItem&gt; comparison)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Sort(comparison As Comparison(Of TItem))</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.comparison-1">Comparison</a>&lt;TItem&gt;</td>
      <td><span class="parametername">comparison</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort*"></a>
<h4 id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_System_Collections_Generic_IComparer__0__" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort(System.Collections.Generic.IComparer{`0})">Sort(IComparer&lt;TItem&gt;)</h4>
<div class="markdown level1 summary"><p>Sorts the elements in the entire collection using the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icomparer-1">IComparer&lt;T&gt;</a>.</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&lt;TItem&gt; comparer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Sort(comparer As IComparer(Of TItem))</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.generic.icomparer-1">IComparer</a>&lt;TItem&gt;</td>
      <td><span class="parametername">comparer</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort*"></a>
<h4 id="GrapeCity_Documents_Common_OwnedCollectionBase_1_Sort_System_Int32_System_Int32_System_Collections_Generic_IComparer__0__" data-uid="GrapeCity.Documents.Common.OwnedCollectionBase`1.Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer{`0})">Sort(int, int, IComparer&lt;TItem&gt;)</h4>
<div class="markdown level1 summary"><p>Sorts the elements in a range of elements using the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icomparer-1">IComparer&lt;T&gt;</a>.</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(int index, int count, IComparer&lt;TItem&gt; comparer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Sort(index As Integer, count As Integer, comparer As IComparer(Of TItem))</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">index</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">count</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icomparer-1">IComparer</a>&lt;TItem&gt;</td>
      <td><span class="parametername">comparer</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
