alexa
menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    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
    Namespace: Syncfusion.Windows.Forms.Collections
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class ObservableList<T> : Object, 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
    System.Int32

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type
    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
    T

    List

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

    Methods

    Add(T)

    Add method.

    Declaration
    public int Add(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type
    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
    System.Boolean

    GetEnumerator()

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type
    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
    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
    System.EventHandler<ListItemEventArgs<T>>

    ItemRemoved

    Fired when item is removed from collection.

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

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved