New to Telerik UI for WinFormsStart a free 30-day trial

Represents a read-only wrapper around an ObservableCollection that provides change notifications.

Definition

Namespace:Telerik.WinControls.Data

Assembly:Telerik.WinControls.dll

Type Parameters:

T

The type of elements in the collection.

Syntax:

C#
public class ReadOnlyObservableCollection<T> : ReadOnlyCollection<T>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged

Inheritance: objectReadOnlyCollection<T>ReadOnlyObservableCollection<T>

Derived Classes: GridViewSelectedCellsCollectionGridViewSelectedRowsCollectionFieldCollection

Implements: ICollectionIEnumerableIListINotifyCollectionChangedINotifyPropertyChanged

Inherited Members ReadOnlyCollection<T>.Contains(T)ReadOnlyCollection<T>.CopyTo(T[], int)ReadOnlyCollection<T>.GetEnumerator()ReadOnlyCollection<T>.IndexOf(T)ReadOnlyCollection<T>.CountReadOnlyCollection<T>.this[int]ReadOnlyCollection<T>.Items...

Constructors

Initializes a new instance of the ReadOnlyObservableCollection<T> class with the specified observable collection.

C#
public ReadOnlyObservableCollection(ObservableCollection<T> list)
Parameters:listObservableCollection<T>

The ObservableCollection to wrap as read-only.

Methods

Fires the CollectionChanged event when the underlying collection changes.

C#
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters:argsNotifyCollectionChangedEventArgs

The event arguments describing the collection change.

Fires the PropertyChanged event when a property of the underlying collection changes.

C#
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
Parameters:argsPropertyChangedEventArgs

The event arguments describing the property change.

Events

Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.

C#
protected event NotifyCollectionChangedEventHandler CollectionChanged

Occurs when when a property of an object changes change. Calling the event is developer's responsibility.

C#
protected event PropertyChangedEventHandler PropertyChanged