Class GridCellRendererCollection
Represents a collection of DataGridCellRenderer<T1, T2> objects in the view.
Implements
Namespace: Syncfusion.Maui.DataGrid
Assembly: Syncfusion.Maui.DataGrid.dll
Syntax
public class GridCellRendererCollection : Disposable, IDisposable, ICollection, IEnumerable
Remarks
In a SfDataGrid control, you can access the GridCellRendererCollection through the CellRenderers property.
The GridCellRendererCollection uses standard Add(String, IDataGridCellRenderer) and Remove(String) methods to manipulate the collection. Uses the Contains method to determine if a specific cell type exists in the collection.
Constructors
GridCellRendererCollection(SfDataGrid)
Initializes a new instance of the GridCellRendererCollection class.
Declaration
public GridCellRendererCollection(SfDataGrid grid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | grid | The reference of the SfDataGrid. |
Properties
Count
Gets the number of elements contained in the System.Collections.ICollection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of elements contained in the System.Collections.ICollection. |
IsSynchronized
Gets a value indicating whether access to the System.Collections.ICollection is synchronized (thread safe).
Declaration
public bool IsSynchronized { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True if access to the System.Collections.ICollection is synchronized (thread safe); otherwise, false. |
Item[String]
Indexer will return the corresponding renderer for the given key value.
Declaration
public IDataGridCellRenderer this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key for which the renderer should be obtained. |
Property Value
Type | Description |
---|---|
IDataGridCellRenderer | The corresponding renderer for the given key value. |
Keys
Gets the keys of the renderers in the collection.
Declaration
public ICollection Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.ICollection | The keys of the renderers in the collection. |
SyncRoot
Gets an object that can be used to synchronize access to the System.Collections.ICollection.
Declaration
public object SyncRoot { get; }
Property Value
Type | Description |
---|---|
System.Object | An object that can be used to synchronize access to the System.Collections.ICollection. |
Values
Gets the renderers in the collection.
Declaration
public ICollection Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.ICollection | The renderers in the collection. |
Methods
Add(String, IDataGridCellRenderer)
Adds the given renderer to the Renderer dictionary.
Declaration
public void Add(string key, IDataGridCellRenderer renderer)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the renderer. |
IDataGridCellRenderer | renderer | The renderer which should be added to the collection. |
Clear()
Clear the values in the renderer dictionary.
Declaration
public void Clear()
ContainsKey(String)
Checks whether the renderer dictionary contains the corresponding renderer key.
Declaration
public bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key which should be queried in the renderer collection. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the Key is found in the Dictionary, otherwise false. |
CopyTo(IDataGridCellRenderer[], Int32)
Copies the renderer values to the array.
Declaration
public void CopyTo(IDataGridCellRenderer[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
IDataGridCellRenderer[] | array | An array of cell renderer. |
System.Int32 | index | The zero-based index in array at which copying begins. |
CopyTo(Array, Int32)
Copies the elements of the System.Collections.ICollection to an System.Array, starting at a given System.Array index.
Declaration
public void CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.ICollection. The System.Array must have zero-based indexing. |
System.Int32 | index | The zero-based index in |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
System.ArgumentNullException |
|
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | The value indicating whether both managed and unmanaged resources should be released. if true - release both managed and unmanaged resources; if false - release only unmanaged resources. |
Overrides
GetEnumerator()
Returns the enumerator for retrieving the values in the cell renderer collection.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The enumerator for retrieving the values in the cell renderer collection. |
Remove(String)
Removes the renderer with the given key value from the dictionary.
Declaration
public void Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key whose renderer should be removed. |