Class GridRowCollection
Implements a two-dimensional table that holds an array of GridCellCollection arrays with GridStyleInfoStore items.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridRowCollection : SFTable, ICloneable, ISerializable, IList, ICollection, IEnumerable
Remarks
This is a memory efficient way to represent a table where values can remain empty. Only rows that actually contain data will allocate a GridCellCollection and the array only holds as many GridStyleInfoStoreobjects as the specific row contains columns.
When you access data that are out of range, an empty () object will be returned. If you set data that are out of range, an exception will be thrown. If you set data for a row that was empty, the row will be allocated before the value is stored.
GridRowCollection provides methods that let you insert, remove, or rearrange columns or rows in the table.
Constructors
GridRowCollection()
Initializes a new instance of the GridRowCollection class that is empty.
Declaration
public GridRowCollection()
GridRowCollection(SFTable)
Initializes a new instance of the GridRowCollection class from an existing table. References to cell objects will be copied into this table from the original table.
Declaration
public GridRowCollection(SFTable data)
Parameters
Type | Name | Description |
---|---|---|
SFTable | data | The original table. |
Remarks
For each row in the original table, a GridCellCollection is added to this GridRowCollection and the references to the cell objects will be copied into the new GridCellCollection.
GridRowCollection(SerializationInfo, StreamingContext)
Initializes a new instance of the GridRowCollection class from the specified instances of the System.Runtime.Serialization.SerializationInfo and System.Runtime.Serialization.StreamingContext classes.
Declaration
protected GridRowCollection(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An instance of the System.Runtime.Serialization.SerializationInfo class containing the information required to serialize the new GridRowCollection instance. |
System.Runtime.Serialization.StreamingContext | context | An instance of the System.Runtime.Serialization.StreamingContext class containing the source of the serialized stream associated with the new GridRowCollection instance. |
Remarks
This constructor implements the System.Runtime.Serialization.ISerializable interface for the GridRowCollection class.
Properties
Count
Gets the number of row elements in this array.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsFixedSize
Gets a value indicating whether IsFixedSize. Always false.
Declaration
public bool IsFixedSize { get; }
Property Value
Type |
---|
System.Boolean |
IsReadOnly
Gets a value indicating whether the array is Read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type |
---|
System.Boolean |
IsSynchronized
Gets a value indicating whether access to the collection is synchronized.
Declaration
public bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Gets or sets a GridCellCollection object at the specified row index.
Declaration
public GridCellCollection this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based row index. |
Property Value
Type |
---|
GridCellCollection |
Item[Int32, Int32]
Gets or sets a GridStyleInfoStore object at the specified coordinates in the GridRowCollection.
Declaration
public GridStyleInfoStore this[int rowIndex, int colIndex] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The zero-based row index. |
System.Int32 | colIndex | The zero-based column index. |
Property Value
Type |
---|
GridStyleInfoStore |
Remarks
If you query for an element and the coordinates are out of range, an empty (null) object will be returned.
If you set an element and the coordinates are out of range, an exception is thrown.
SyncRoot
Gets not supported.
Declaration
public object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Methods
Add(GridCellCollection)
Adds a GridCellCollection to the array.
Declaration
public int Add(GridCellCollection value)
Parameters
Type | Name | Description |
---|---|---|
GridCellCollection | value | Value to add. |
Returns
Type | Description |
---|---|
System.Int32 | The position into which the value was inserted |
Clone()
Creates a deep copy of the GridRowCollection where each row and cell object is cloned.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A deep copy of the GridRowCollection. |
Overrides
Contains(GridCellCollection)
Determines if the array contains the specified GridCellCollection.
Declaration
public bool Contains(GridCellCollection value)
Parameters
Type | Name | Description |
---|---|---|
GridCellCollection | value | Value to search. |
Returns
Type | Description |
---|---|
System.Boolean |
|
CopyTo(GridCellCollection[], Int32)
Copied references of row elements to the specified array, starting at a particular index.
Declaration
public void CopyTo(GridCellCollection[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
GridCellCollection[] | array | The target collection. |
System.Int32 | index | The starting index. |
CreateCellCollection()
Creates an empty GridCellCollection.
Declaration
public override SFArrayList CreateCellCollection()
Returns
Type | Description |
---|---|
SFArrayList | An empty GridCellCollection. |
Overrides
GetEnumerator()
Returns an enumerator for the list of rows.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An enumerator. |
GetObjectData(SerializationInfo, StreamingContext)
Returns the data needed to serialize the SFTable.
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | A System.Runtime.Serialization.SerializationInfo object containing the information required to serialize the object. |
System.Runtime.Serialization.StreamingContext | context | A System.Runtime.Serialization.StreamingContext object containing the source and destination of the serialized stream. |
Overrides
IndexOf(GridCellCollection)
Determines the index of the specified GridCellCollection in the array.
Declaration
public int IndexOf(GridCellCollection value)
Parameters
Type | Name | Description |
---|---|---|
GridCellCollection | value | The value whose index needs to be retrieved. |
Returns
Type | Description |
---|---|
System.Int32 | returns Index. |
Insert(Int32, GridCellCollection)
Inserts a GridCellCollection at the specified row index.
Declaration
public void Insert(int index, GridCellCollection value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Row index. |
GridCellCollection | value | Value to insert. |
Remove(GridCellCollection)
Removes the GridCellCollection from the array.
Declaration
public void Remove(GridCellCollection value)
Parameters
Type | Name | Description |
---|---|---|
GridCellCollection | value | Value to remove |
RemoveAt(Int32)
Removes the GridCellCollection at the specified row index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the value to be removed. |
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 |
IList.Add(Object)
Declaration
int IList.Add(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type |
---|
System.Int32 |
IList.Clear()
Declaration
void IList.Clear()
IList.Contains(Object)
Declaration
bool IList.Contains(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type |
---|
System.Boolean |
IList.get_Item(Int32)
Declaration
object IList.get_Item(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.Object |
IList.IndexOf(Object)
Declaration
int IList.IndexOf(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type |
---|
System.Int32 |
IList.Insert(Int32, Object)
Declaration
void IList.Insert(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |
IList.Item[Int32]
Gets or sets the element at the specified index.
Declaration
object IList.this[] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element to get or set. |
Returns
Type | Description |
---|---|
System.Object | The element at the specified index. |
IList.Remove(Object)
Declaration
void IList.Remove(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
IList.set_Item(Int32, Object)
Declaration
void IList.set_Item(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |