# GrapeCity.Win.Spread.InputMan.CellType.CollectionBase-1.FindLastIndex

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex*">FindLastIndex Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex__1" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex``1">FindLastIndex&lt;TTarget&gt;()</h4>
<div class="markdown level1 summary"><p>Searches for an element that matches the conditions defined by the specified predicate, and returns
the zero-based index of the last occurrence within the entire <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List&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 int FindLastIndex&lt;TTarget&gt;() where TTarget : T</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function FindLastIndex(Of TTarget As T)() As Integer</code></pre>
</div>
<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 zero-based index of the last occurrence of an element that matches the conditions defined by match,
if found; otherwise, false.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">TTarget</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex__1_System_Predicate___0__" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex``1(System.Predicate{``0})">FindLastIndex&lt;TTarget&gt;(Predicate&lt;TTarget&gt;)</h4>
<div class="markdown level1 summary"><p>Searches for an element that matches the conditions defined by the specified predicate, and returns the
zero-based index of the last occurrence within the entire <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List&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 int FindLastIndex&lt;TTarget&gt;(Predicate&lt;TTarget&gt; match) where TTarget : T</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function FindLastIndex(Of TTarget As T)(match As Predicate(Of TTarget)) 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="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate</a>&lt;TTarget&gt;</td>
      <td><span class="parametername">match</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate&lt;T&gt;</a> delegate that defines the conditions of the element to search for.</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 zero-based index of the last occurrence of an element that matches the conditions defined by match,
if found; otherwise, false.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">TTarget</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>match is null.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex__1_System_Int32_System_Predicate___0__" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex``1(System.Int32,System.Predicate{``0})">FindLastIndex&lt;TTarget&gt;(int, Predicate&lt;TTarget&gt;)</h4>
<div class="markdown level1 summary"><p>Searches for an element that matches the conditions defined by the specified predicate,
and returns the zero-based index of the last occurrence within the range of elements in
the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List&lt;T&gt;</a> that extends from the first
element to the specified index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int FindLastIndex&lt;TTarget&gt;(int startIndex, Predicate&lt;TTarget&gt; match) where TTarget : T</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function FindLastIndex(Of TTarget As T)(startIndex As Integer, match As Predicate(Of TTarget)) 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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">startIndex</span></td>
      <td><p>The zero-based starting index of the backward search.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate</a>&lt;TTarget&gt;</td>
      <td><span class="parametername">match</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate&lt;T&gt;</a> delegate that defines the conditions of the element to search for.</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 zero-based index of the last occurrence of an element that matches the conditions
defined by match, if found; otherwise, false.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">TTarget</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p>startIndex is outside the range of valid indexes for the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List&lt;T&gt;</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>match is null.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_CollectionBase_1_FindLastIndex__1_System_Int32_System_Int32_System_Predicate___0__" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CollectionBase`1.FindLastIndex``1(System.Int32,System.Int32,System.Predicate{``0})">FindLastIndex&lt;TTarget&gt;(int, int, Predicate&lt;TTarget&gt;)</h4>
<div class="markdown level1 summary"><p>Searches for an element that matches the conditions defined by the specified predicate,
and returns the zero-based index of the last occurrence within the range of elements in the
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List&lt;T&gt;</a> that contains the specified number of
elements and ends at the specified index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int FindLastIndex&lt;TTarget&gt;(int startIndex, int count, Predicate&lt;TTarget&gt; match) where TTarget : T</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function FindLastIndex(Of TTarget As T)(startIndex As Integer, count As Integer, match As Predicate(Of TTarget)) 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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">startIndex</span></td>
      <td><p>The zero-based starting index of the backward search.</p>
</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><p>The number of elements in the section to search.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate</a>&lt;TTarget&gt;</td>
      <td><span class="parametername">match</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate&lt;T&gt;</a> delegate that defines the conditions of the element to search for.</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 zero-based index of the last occurrence of an element that matches the conditions
defined by match, if found; otherwise, false.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">TTarget</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p>count is less than 0.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>match is null.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
