# C1.Win.GanttView.TaskCollection

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_GanttView_TaskCollection" data-uid="C1.Win.GanttView.TaskCollection" class="text-break">TaskCollection Class
</h1>
  <div class="markdown level0 summary"><p>Represents a collection of tasks.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">TaskCollection</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.itypedlist">ITypedList</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.ibindinglist">IBindingList</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ilist">IList</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.icanceladdnew">ICancelAddNew</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.iraiseitemchangedevents">IRaiseItemChangedEvents</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.GanttView.html">C1.Win.GanttView</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.GanttView.10.dll</h6>
  <h5 id="C1_Win_GanttView_TaskCollection_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[ListBindable(true)]
public class TaskCollection : BaseCollection&lt;Task&gt;, ITypedList, IBindingList, IList, ICollection, IEnumerable, ICancelAddNew, IRaiseItemChangedEvents</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;ListBindable(True)&gt;
Public Class TaskCollection
    Inherits BaseCollection(Of Task)
    Implements ITypedList, IBindingList, IList, ICollection, IEnumerable, ICancelAddNew, IRaiseItemChangedEvents</code></pre>
  </div>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_AllowEdit" data-uid="C1.Win.GanttView.TaskCollection.AllowEdit">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.AllowEdit.html#C1_Win_GanttView_TaskCollection_AllowEdit">AllowEdit</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether items in the underlying list can be edited.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_AllowNew" data-uid="C1.Win.GanttView.TaskCollection.AllowNew">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.AllowNew.html#C1_Win_GanttView_TaskCollection_AllowNew">AllowNew</a>
        </td>
        <td class="markdown level1 summary"><p>Gets whether you can add items to the list using AddNew.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_AllowRemove" data-uid="C1.Win.GanttView.TaskCollection.AllowRemove">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.AllowRemove.html#C1_Win_GanttView_TaskCollection_AllowRemove">AllowRemove</a>
        </td>
        <td class="markdown level1 summary"><p>Gets whether you can remove items from the list, using Remove or RemoveAt.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_NonEmptyTaskCount" data-uid="C1.Win.GanttView.TaskCollection.NonEmptyTaskCount">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.NonEmptyTaskCount.html#C1_Win_GanttView_TaskCollection_NonEmptyTaskCount">NonEmptyTaskCount</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the number of non-empty tasks in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_SupportsSorting" data-uid="C1.Win.GanttView.TaskCollection.SupportsSorting">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.SupportsSorting.html#C1_Win_GanttView_TaskCollection_SupportsSorting">SupportsSorting</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the list supports sorting.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_Add_C1_Win_GanttView_Task_" data-uid="C1.Win.GanttView.TaskCollection.Add(C1.Win.GanttView.Task)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.Add.html#C1_Win_GanttView_TaskCollection_Add_C1_Win_GanttView_Task_">Add(Task)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds a new Task object to the collection.
If the item already exists in the collection, its index is returned.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_AddNew" data-uid="C1.Win.GanttView.TaskCollection.AddNew">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.AddNew.html#C1_Win_GanttView_TaskCollection_AddNew">AddNew()</a>
        </td>
        <td class="markdown level1 summary"><p>Adds a new item to the list.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_ApplySort_System_ComponentModel_PropertyDescriptor_System_ComponentModel_ListSortDirection_" data-uid="C1.Win.GanttView.TaskCollection.ApplySort(System.ComponentModel.PropertyDescriptor,System.ComponentModel.ListSortDirection)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.ApplySort.html#C1_Win_GanttView_TaskCollection_ApplySort_System_ComponentModel_PropertyDescriptor_System_ComponentModel_ListSortDirection_">ApplySort(PropertyDescriptor, ListSortDirection)</a>
        </td>
        <td class="markdown level1 summary"><p>Sorts the tasks.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_BeginUpdate" data-uid="C1.Win.GanttView.TaskCollection.BeginUpdate">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.BeginUpdate.html#C1_Win_GanttView_TaskCollection_BeginUpdate">BeginUpdate()</a>
        </td>
        <td class="markdown level1 summary"><p>Begin updating collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_CancelNew_System_Int32_" data-uid="C1.Win.GanttView.TaskCollection.CancelNew(System.Int32)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.CancelNew.html#C1_Win_GanttView_TaskCollection_CancelNew_System_Int32_">CancelNew(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Discards a pending new item.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_Clear" data-uid="C1.Win.GanttView.TaskCollection.Clear">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.Clear.html#C1_Win_GanttView_TaskCollection_Clear">Clear()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all tasks from the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_ClearAndDispose" data-uid="C1.Win.GanttView.TaskCollection.ClearAndDispose">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.ClearAndDispose.html#C1_Win_GanttView_TaskCollection_ClearAndDispose">ClearAndDispose()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all tasks from the collection, then disposes the tasks.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_ClearItems" data-uid="C1.Win.GanttView.TaskCollection.ClearItems">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.ClearItems.html#C1_Win_GanttView_TaskCollection_ClearItems">ClearItems()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all items from the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_EndNew_System_Int32_" data-uid="C1.Win.GanttView.TaskCollection.EndNew(System.Int32)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.EndNew.html#C1_Win_GanttView_TaskCollection_EndNew_System_Int32_">EndNew(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Commits a pending new item to the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_EndUpdate" data-uid="C1.Win.GanttView.TaskCollection.EndUpdate">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.EndUpdate.html#C1_Win_GanttView_TaskCollection_EndUpdate">EndUpdate()</a>
        </td>
        <td class="markdown level1 summary"><p>End updating collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_IndexOf_System_Int32_" data-uid="C1.Win.GanttView.TaskCollection.IndexOf(System.Int32)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.IndexOf.html#C1_Win_GanttView_TaskCollection_IndexOf_System_Int32_">IndexOf(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Searches for the specified ID and returns the zero-based index of the corresponding task.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_IndexOf_System_String_" data-uid="C1.Win.GanttView.TaskCollection.IndexOf(System.String)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.IndexOf.html#C1_Win_GanttView_TaskCollection_IndexOf_System_String_">IndexOf(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Searches for the specified Name and returns the zero-based index of the corresponding task.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_InsertItem_System_Int32_C1_Win_GanttView_Task_" data-uid="C1.Win.GanttView.TaskCollection.InsertItem(System.Int32,C1.Win.GanttView.Task)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.InsertItem.html#C1_Win_GanttView_TaskCollection_InsertItem_System_Int32_C1_Win_GanttView_Task_">InsertItem(int, Task)</a>
        </td>
        <td class="markdown level1 summary"><p>Inserts an item at the specified index.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_OnItemChanged_C1_Win_GanttView_ItemEventArgs_" data-uid="C1.Win.GanttView.TaskCollection.OnItemChanged(C1.Win.GanttView.ItemEventArgs)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.OnItemChanged.html#C1_Win_GanttView_TaskCollection_OnItemChanged_C1_Win_GanttView_ItemEventArgs_">OnItemChanged(ItemEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Handles the <span class="xref">ItemChanged</span> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_OnItemDeleted_C1_Win_GanttView_ItemEventArgs_" data-uid="C1.Win.GanttView.TaskCollection.OnItemDeleted(C1.Win.GanttView.ItemEventArgs)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.OnItemDeleted.html#C1_Win_GanttView_TaskCollection_OnItemDeleted_C1_Win_GanttView_ItemEventArgs_">OnItemDeleted(ItemEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Handles the <span class="xref">ItemDeleted</span> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_OnItemInserted_C1_Win_GanttView_ItemEventArgs_" data-uid="C1.Win.GanttView.TaskCollection.OnItemInserted(C1.Win.GanttView.ItemEventArgs)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.OnItemInserted.html#C1_Win_GanttView_TaskCollection_OnItemInserted_C1_Win_GanttView_ItemEventArgs_">OnItemInserted(ItemEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Handles the <span class="xref">ItemInserted</span> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_OnListChanged_System_ComponentModel_ListChangedEventArgs_" data-uid="C1.Win.GanttView.TaskCollection.OnListChanged(System.ComponentModel.ListChangedEventArgs)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.OnListChanged.html#C1_Win_GanttView_TaskCollection_OnListChanged_System_ComponentModel_ListChangedEventArgs_">OnListChanged(ListChangedEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the ListChanged event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_OriginalIndexOf_C1_Win_GanttView_Task_" data-uid="C1.Win.GanttView.TaskCollection.OriginalIndexOf(C1.Win.GanttView.Task)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.OriginalIndexOf.html#C1_Win_GanttView_TaskCollection_OriginalIndexOf_C1_Win_GanttView_Task_">OriginalIndexOf(Task)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the original zero-based index of the task.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_RemoveItem_System_Int32_" data-uid="C1.Win.GanttView.TaskCollection.RemoveItem(System.Int32)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.RemoveItem.html#C1_Win_GanttView_TaskCollection_RemoveItem_System_Int32_">RemoveItem(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes the item at the specified index.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_RemoveSort" data-uid="C1.Win.GanttView.TaskCollection.RemoveSort">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.RemoveSort.html#C1_Win_GanttView_TaskCollection_RemoveSort">RemoveSort()</a>
        </td>
        <td class="markdown level1 summary"><p>Remove all sorts were applied to the tasks.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_ResetBindings" data-uid="C1.Win.GanttView.TaskCollection.ResetBindings">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.ResetBindings.html#C1_Win_GanttView_TaskCollection_ResetBindings">ResetBindings()</a>
        </td>
        <td class="markdown level1 summary"><p>Causes a control bound to the collection to reread all the items in the list and refresh their displayed values.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_ResetItem_System_Int32_" data-uid="C1.Win.GanttView.TaskCollection.ResetItem(System.Int32)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.ResetItem.html#C1_Win_GanttView_TaskCollection_ResetItem_System_Int32_">ResetItem(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Causes a control bound to the collection to reread the item at the specified index, and refresh its displayed value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_Search_System_Int32_" data-uid="C1.Win.GanttView.TaskCollection.Search(System.Int32)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.Search.html#C1_Win_GanttView_TaskCollection_Search_System_Int32_">Search(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Searches for a <a class="xref" href="C1.Win.GanttView.Task.html">Task</a> with the specified ID.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_Search_System_String_" data-uid="C1.Win.GanttView.TaskCollection.Search(System.String)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.Search.html#C1_Win_GanttView_TaskCollection_Search_System_String_">Search(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Searches for a <a class="xref" href="C1.Win.GanttView.Task.html">Task</a> with the specified Name.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_SetItem_System_Int32_C1_Win_GanttView_Task_" data-uid="C1.Win.GanttView.TaskCollection.SetItem(System.Int32,C1.Win.GanttView.Task)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.SetItem.html#C1_Win_GanttView_TaskCollection_SetItem_System_Int32_C1_Win_GanttView_Task_">SetItem(int, Task)</a>
        </td>
        <td class="markdown level1 summary"><p>Replaces the item at the specified index.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_Sort_System_ComponentModel_PropertyDescriptor_System_ComponentModel_ListSortDirection_" data-uid="C1.Win.GanttView.TaskCollection.Sort(System.ComponentModel.PropertyDescriptor,System.ComponentModel.ListSortDirection)">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.Sort.html#C1_Win_GanttView_TaskCollection_Sort_System_ComponentModel_PropertyDescriptor_System_ComponentModel_ListSortDirection_">Sort(PropertyDescriptor, ListSortDirection)</a>
        </td>
        <td class="markdown level1 summary"><p>Sorts the tasks.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_AddingNew" data-uid="C1.Win.GanttView.TaskCollection.AddingNew">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.AddingNew.html">AddingNew</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs before an item is added to the underlying list.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_GanttView_TaskCollection_ListChanged" data-uid="C1.Win.GanttView.TaskCollection.ListChanged">
          <a class="xref" href="C1.Win.GanttView.TaskCollection.ListChanged.html">ListChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when the list changes or an item in the list changes.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
