Class GridCellModelCollection
Implements a collection of GridCellModelBase objects in the GridModel.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridCellModelCollection : GridModelBound, IDisposable, ICollection, IEnumerable, ISerializable, ICloneable
Remarks
On the GridModel, you access the GridCellModelCollection through the CellModels property.
The GridCellModelCollection uses standard Add(String, GridCellModelBase) and Remove(String) methods to manipulate the collection. Use the Contains method to determine if a specific cell type exists in the collection.
Examples
TODO: Show how to register cell types.
Constructors
GridCellModelCollection(GridModel)
Initializes an empty instances of GridCellModelCollection and associates it with a GridModel.
Declaration
public GridCellModelCollection(GridModel model)
Parameters
Type | Name | Description |
---|---|---|
GridModel | model | The GridModel that owns this collection of cell types. |
GridCellModelCollection(SerializationInfo, StreamingContext)
Initializes a new iinstance ofGridCellModelCollection from a serialization stream.
Declaration
protected GridCellModelCollection(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or de-serialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Properties
Count
Gets the number of cellTypeName-and-value pairs in the GridCellModelCollection.
Declaration
public virtual int Count { get; }
Property Value
Type |
---|
System.Int32 |
DefaultCellType
Gets or sets the default cell type to be used for cells where a specific cell type could not be loaded.
Declaration
public string DefaultCellType { get; set; }
Property Value
Type |
---|
System.String |
IsSynchronized
Gets a value indicating whether access to the GridCellModelCollection is synchronized (thread-safe).
Declaration
public virtual bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Item[String]
Gets or sets the GridCellModelBase for the specific cell type name.
Declaration
public virtual GridCellModelBase this[string cellTypeName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | cellTypeName |
Property Value
Type |
---|
GridCellModelBase |
Keys
Gets a collection of cellTypeNames in the GridCellModelCollection.
Declaration
public virtual ICollection Keys { get; }
Property Value
Type |
---|
System.Collections.ICollection |
SyncRoot
Gets an object that can be used to synchronize access to the GridCellModelCollection.
Declaration
public virtual object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Values
Gets a collection of values in the GridCellModelCollection.
Declaration
public virtual ICollection Values { get; }
Property Value
Type |
---|
System.Collections.ICollection |
Methods
Add(String, GridCellModelBase)
Adds cell model with the specified cellTypeName into the GridCellModelCollection.
Declaration
public virtual void Add(string cellTypeName, GridCellModelBase model)
Parameters
Type | Name | Description |
---|---|---|
System.String | cellTypeName | The cellTypeName of the entry to add. |
GridCellModelBase | model | The cell model of the entry to add. |
Clear()
Removes all entries from the GridCellModelCollection.
Declaration
public virtual void Clear()
Clone()
Creates a copy of this object using System.Object.MemberwiseClone().
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | An exact copy of this object. |
ContainsKey(String)
Determines if the GridCellModelCollection contains a specific cellTypeName.
Declaration
public virtual bool ContainsKey(string cellTypeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | cellTypeName | The cellTypeName to locate in the GridCellModelCollection. |
Returns
Type | Description |
---|---|
System.Boolean | true if the GridCellModelCollection contains an entry with the specified cellTypeName; otherwise, false. |
ContainsValue(GridCellModelBase)
Determines if the GridCellModelCollection contains a specific value.
Declaration
public virtual bool ContainsValue(GridCellModelBase cellModel)
Parameters
Type | Name | Description |
---|---|---|
GridCellModelBase | cellModel | The value to locate in the GridCellModelCollection. |
Returns
Type | Description |
---|---|
System.Boolean | true if the GridCellModelCollection contains an element with the specified value; otherwise, false. |
CopyTo(GridCellModelBase[], Int32)
Copies the cell model dictionary values to a one-dimensional System.Array instance at the specified index.
Declaration
public virtual void CopyTo(GridCellModelBase[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
GridCellModelBase[] | array | The one-dimensional System.Array that is the destination of the values copied from the GridCellModelCollection. |
System.Int32 | index | The index in the array where copying begins. |
Dispose(Boolean)
Disposes the unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetEnumerator()
Returns an enumerator that can iterate through the cell model dictionary.
Declaration
public virtual IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator that can iterate through the string dictionary. |
OnCollectionChanged(CollectionChangeEventArgs)
Raises the CellModelsChanged event.
Declaration
protected virtual void OnCollectionChanged(CollectionChangeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CollectionChangeEventArgs | e | A System.ComponentModel.CollectionChangeEventArgs that contains the event data. |
OnModelDeserialization(Object, GridModel)
This is called after the model has been de-serialized from the GridModel implementation of System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object).
Declaration
protected override void OnModelDeserialization(object sender, GridModel model)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
GridModel | model | Reference to the GridModel this object is associated with. |
Overrides
Remove(String)
Removes the entry with the specified cellTypeName from the cell model dictionary.
Declaration
public virtual void Remove(string cellTypeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | cellTypeName | The cellTypeName of the entry to remove. |
Explicit Interface Implementations
ICollection.CopyTo(Array, Int32)
Declaration
void ICollection.CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | |
System.Int32 | index |
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the GridCellModelCollection.
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | A SerializationInfo object containing the information required to serialize the object. |
System.Runtime.Serialization.StreamingContext | context | A StreamingContext object containing the source and destination of the serialized stream. |