Class GridSelectedCellCollection
Represents a collection of SelectedCellsInfo, that represent the selected cells in a SfDataGrid control. This class cannot be inherited.
Inheritance
Implements
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class GridSelectedCellCollection : Object, IList<SelectedCellsInfo>, ICollection<SelectedCellsInfo>, IEnumerable<SelectedCellsInfo>, IEnumerable
Remarks
Use the GridSelectedCellscollection to programmatically manage a collection of SelectedCellsInfo in a SfDataGrid control. You can add, remove or insert cells to the GridSelectedCells collection.
Constructors
GridSelectedCellCollection()
Initializes a new instance of the GridSelectedCellCollection class.
Declaration
public GridSelectedCellCollection()
Properties
Count
Gets the number of cells info contained in the GridSelectedCellCollection list.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of elements contained in the GridSelectedCellCollection list. |
IsReadOnly
Gets a value indicating whether the GridSelectedCellCollection list is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the GridSelectedCellCollection list is read only; otherwise, false. |
Item[Int32]
Gets or sets the selected cells information at the specified index.
Declaration
public SelectedCellsInfo this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index for retrieving the selected cell info. |
Property Value
Type | Description |
---|---|
SelectedCellsInfo | Returns the selected cells information at the specified index. |
Methods
Add(SelectedCellInfo)
Adds the specific cell info into the GridSelectedCellCollection list.
Declaration
public void Add(SelectedCellInfo cellInfo)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellInfo | cellInfo | The cell info to add. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the cell info argument value is null. |
Add(SelectedCellsInfo)
Adds the specific cells info into the GridSelectedCellCollection list.
Declaration
public void Add(SelectedCellsInfo cellsInfo)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellsInfo | cellsInfo | The selected cells info to add. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the cells info argument value is null. |
Clear()
Removes all elements from the GridSelectedCellCollection list.
Declaration
public void Clear()
Contains(SelectedCellInfo)
Determines whether the specific cell info is in the GridSelectedCellCollection list.
Declaration
public bool Contains(SelectedCellInfo cellInfo)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellInfo | cellInfo | The cell info to locate in the GridSelectedCellCollection list. |
Returns
Type | Description |
---|---|
System.Boolean | true if the cell info is found in the GridSelectedCellCollection list; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the cell info argument value is null. |
Contains(SelectedCellsInfo)
Determines whether the specific cells info contains in the GridSelectedCellCollection list.
Declaration
public bool Contains(SelectedCellsInfo cellsInfo)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellsInfo | cellsInfo | The cells info to locate in the GridSelectedCellCollection list. |
Returns
Type | Description |
---|---|
System.Boolean | true if the cells info is found in the GridSelectedCellCollection list; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the cells info argument value is null. |
CopyTo(SelectedCellsInfo[], Int32)
Copies all the cells information to the specified destination array index.
Declaration
public void CopyTo(SelectedCellsInfo[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellsInfo[] | array | An One-dimensional array that is the destination of the elements copied from the current array. |
System.Int32 | arrayIndex | The index in array at which copying begins. |
GetEnumerator()
Gets an enumerator that iterates through the GridSelectedCellCollection list.
Declaration
public IEnumerator<SelectedCellsInfo> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<SelectedCellsInfo> | The enumerator for the GridSelectedCellCollection list. |
IndexOf(SelectedCellsInfo)
Searches for the specified selected cells info and returns zero-based index of the first occurrence with in the GridSelectedCellCollection.
Declaration
public int IndexOf(SelectedCellsInfo item)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellsInfo | item | The selected cells info that locate in the internal selected cells list. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the first occurrence of selected cells info , if its found on the GridSelectedCellCollection; otherwise, –1. |
Insert(Int32, SelectedCellInfo)
Inserts a specified cell info into the GridSelectedCellCollection at the specified index.
Declaration
public void Insert(int index, SelectedCellInfo cellInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Zero-based index at which cell info should be inserted. |
SelectedCellInfo | cellInfo | The cell info to insert. |
Insert(Int32, SelectedCellsInfo)
Inserts a new cells info into the GridSelectedCellCollection at the specified index.
Declaration
public void Insert(int index, SelectedCellsInfo newItem)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Zero-based index at which cells information should be inserted. . |
SelectedCellsInfo | newItem | The new item to insert. |
Remove(SelectedCellInfo)
Removes the first occurrence of a specific cell info from the GridSelectedCellCollection list.
Declaration
public bool Remove(SelectedCellInfo cellInfo)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellInfo | cellInfo | The cell info to remove from the GridSelectedCellCollection list. |
Returns
Type | Description |
---|---|
System.Boolean | true if the item removed; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the cell info argument value is null. |
Remove(SelectedCellsInfo)
Removes the first occurrence of a specific cells info from the GridSelectedCellCollection list.
Declaration
public bool Remove(SelectedCellsInfo cellsInfo)
Parameters
Type | Name | Description |
---|---|---|
SelectedCellsInfo | cellsInfo | The cells info to remove from the GridSelectedCellCollection list. |
Returns
Type | Description |
---|---|
System.Boolean | true if the cells info removed; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the cells info argument value is null. |
RemoveAt(Int32)
Removes the cells info at specified index of the GridSelectedCellCollection.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element to remove. |