# C1.C1Preview.DataBinding.SortExpressionCollection.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add*"></a>
<h4 id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_System_String_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add(System.String)">Add(string)</h4>
<div class="markdown level1 summary"><p>Adds an ascending <a class="xref" href="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a> specified by the expression text
to the current collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SortExpression Add(string expression)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(expression As String) As SortExpression</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.string">string</a></td>
      <td><span class="parametername">expression</span></td>
      <td><p>The sort expression text.</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="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a></td>
      <td><p>The <a class="xref" href="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a> object that was created and added to the current collection.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add*"></a>
<h4 id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_System_String_C1_C1Preview_DataBinding_SortDirectionEnum_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add(System.String,C1.C1Preview.DataBinding.SortDirectionEnum)">Add(string, SortDirectionEnum)</h4>
<div class="markdown level1 summary"><p>Adds a <a class="xref" href="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a> specified by the expression text and sort direction
to the current collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SortExpression Add(string expression, SortDirectionEnum sortDirection)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(expression As String, sortDirection As SortDirectionEnum) As SortExpression</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.string">string</a></td>
      <td><span class="parametername">expression</span></td>
      <td><p>The sort expression text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.C1Preview.DataBinding.SortDirectionEnum.html">SortDirectionEnum</a></td>
      <td><span class="parametername">sortDirection</span></td>
      <td><p>The sort direction.</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="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a></td>
      <td><p>The <a class="xref" href="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a> object that was created and added to the current collection.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add*"></a>
<h4 id="C1_C1Preview_DataBinding_SortExpressionCollection_Add_C1_C1Preview_DataBinding_SortExpression_" data-uid="C1.C1Preview.DataBinding.SortExpressionCollection.Add(C1.C1Preview.DataBinding.SortExpression)">Add(SortExpression)</h4>
<div class="markdown level1 summary"><p>Adds a <a class="xref" href="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a> object to the current collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int Add(SortExpression expression)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(expression As SortExpression) 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.C1Preview.DataBinding.SortExpression.html">SortExpression</a></td>
      <td><span class="parametername">expression</span></td>
      <td><p>The <a class="xref" href="C1.C1Preview.DataBinding.SortExpression.html">SortExpression</a> object to add.</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.int32">int</a></td>
      <td><p>The index of the added object in the current collection.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
