WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ObservableList<T> - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ObservableList<T>

    Extends List{T} with events.

    Inheritance
    System.Object
    ObservableList<T>
    TabGroupCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Collections
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class ObservableList<T> : IList, ICollection, IEnumerable
    Type Parameters
    Name Description
    T

    Type of collection elements.

    Constructors

    ObservableList()

    Declaration
    public ObservableList()

    ObservableList(Int32)

    Declaration
    public ObservableList(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity

    Properties

    Capacity

    Declaration
    public int Capacity { get; set; }
    Property Value
    Type Description
    System.Int32

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    Item[Int32]

    Gets or sets the element at the specified index.

    Declaration
    public T this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    T

    List

    Declaration
    protected IList List { get; }
    Property Value
    Type Description
    System.Collections.IList

    Methods

    Add(T)

    Add method.

    Declaration
    public int Add(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    System.Int32

    Clear()

    Removes all items from the list.

    Declaration
    public void Clear()

    Contains(T)

    Determines whether the list contains a specific value.

    Declaration
    public bool Contains(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    System.Boolean

    GetEnumerator()

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    IndexOf(T)

    Determines the index of a specific item in the list.

    Declaration
    public int IndexOf(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    System.Int32

    Insert(Int32, T)

    Inserts an item to the list at the specified index.

    Declaration
    public void Insert(int index, T value)
    Parameters
    Type Name Description
    System.Int32 index
    T value

    OnClear()

    Declaration
    protected virtual void OnClear()

    OnClearCompleted()

    Declaration
    protected virtual void OnClearCompleted()

    OnInsert(Int32, Object)

    Performs additional custom processes before inserting a new element into the collection.

    Declaration
    protected virtual bool OnInsert(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value
    Returns
    Type Description
    System.Boolean

    TRUE to insert object

    OnInsertComplete(Int32, Object)

    Fires ItemAdded event.

    Declaration
    protected virtual void OnInsertComplete(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value

    OnRemove(Int32, Object)

    Performs additional custom processes when removing an element from the collection.

    Declaration
    protected virtual bool OnRemove(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value
    Returns
    Type Description
    System.Boolean

    TRUE to remove object

    OnRemoveComplete(Int32, Object)

    Fires ItemRemoved event.

    Declaration
    protected virtual void OnRemoveComplete(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value

    Remove(T)

    Removes the first occurrence of a specific object from the collection.

    Declaration
    public void Remove(T value)
    Parameters
    Type Name Description
    T value

    RemoveAt(Int32)

    Removes item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    Sort(IComparer)

    Declaration
    public void Sort(IComparer comparer)
    Parameters
    Type Name Description
    System.Collections.IComparer comparer

    Events

    ItemAdded

    Fired when new item is added to the collection.

    Declaration
    public event EventHandler<ListItemEventArgs<T>> ItemAdded
    Event Type
    Type Description
    System.EventHandler<ListItemEventArgs<T>>

    ItemRemoved

    Fired when item is removed from collection.

    Declaration
    public event EventHandler<ListItemEventArgs<T>> ItemRemoved
    Event Type
    Type Description
    System.EventHandler<ListItemEventArgs<T>>

    Explicit Interface Implementations

    ICollection.CopyTo(Array, Int32)

    Copies the elements of the ICollection to an Array, starting at a particular Array index.

    Declaration
    void ICollection.CopyTo(Array array, int index)
    Parameters
    Type Name Description
    System.Array array
    System.Int32 index

    ICollection.Count

    Gets the number of elements contained in the ICollection.

    Declaration
    int ICollection.Count { get; }
    Returns
    Type Description
    System.Int32

    ICollection.IsSynchronized

    Gets a value indicating whether access to the collection is synchronized

    Declaration
    bool ICollection.IsSynchronized { get; }
    Returns
    Type Description
    System.Boolean

    ICollection.SyncRoot

    Gets an object that can be used to synchronize access to the collection.

    Declaration
    object ICollection.SyncRoot { get; }
    Returns
    Type Description
    System.Object

    IEnumerable.GetEnumerator()

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    IList.Add(Object)

    Adds an item to the list.

    Declaration
    int IList.Add(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Int32

    IList.Clear()

    Removes all items from the list.

    Declaration
    void IList.Clear()

    IList.Contains(Object)

    Determines whether the list contains a specific value.

    Declaration
    bool IList.Contains(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Boolean

    IList.get_Item(Int32)

    Declaration
    object IList.get_Item(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Returns
    Type Description
    System.Object

    IList.IndexOf(Object)

    Determines the index of a specific item in the list.

    Declaration
    int IList.IndexOf(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Int32

    IList.Insert(Int32, Object)

    Inserts an item to the list at the specified index.

    Declaration
    void IList.Insert(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value

    IList.IsFixedSize

    Gets a value indicating whether the list has a fixed size.

    Declaration
    bool IList.IsFixedSize { get; }
    Returns
    Type Description
    System.Boolean

    IList.IsReadOnly

    Gets a value indicating whether the list is read-only.

    Declaration
    bool IList.IsReadOnly { get; }
    Returns
    Type Description
    System.Boolean

    IList.Item[Int32]

    Gets or sets the element at the specified index.

    Declaration
    object IList.this[] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Returns
    Type Description
    System.Object

    IList.Remove(Object)

    Removes the first occurrence of a specific object from the list.

    Declaration
    void IList.Remove(object value)
    Parameters
    Type Name Description
    System.Object value

    IList.RemoveAt(Int32)

    Removes item at the specified index.

    Declaration
    void IList.RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    IList.set_Item(Int32, Object)

    Declaration
    void IList.set_Item(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable

    Extension Methods

    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    FunctionalExtensions.MoveTo(IList, Int32, Int32)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved