Class GridModelRowStylesIndexer
Implements the functionalities that provides access to a grid row styles collection with an indexer.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridModelRowStylesIndexer : GridModelBound, IDisposable, ICollection, IEnumerable
Remarks
Properties
Count
Gets the number of rows in the grid RowCount.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsSynchronized
Gets a value indicating whether Is Synchronized. Always false.
Declaration
public bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Gets or sets the row style information of a row.
Declaration
public GridStyleInfo this[int rowIndex] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex |
Property Value
Type |
---|
GridStyleInfo |
Remarks
The indexer provides you with a very simple way to query and change row style contents.
Examples
The following example make some changes to the grid using the indexer:
model.RowStyles[2].Font.Bold = true;
model.RowStyles[2].Font.Size = 16;
model.RowStyles[2].HorizontalAlignment = GridHorizontalAlignment.Center;
model.RowStyles[2].VerticalAlignment = GridVerticalAlignment.Middle;
model.RowStyles[2].CellType = "Static";
model.RowStyles[2].Borders.All = new GridBorder(GridBorderStyle.Solid, Color.FromArgb(100, 238, 122, 3));
model.RowStyles[2].Interior = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(100, 57, 73, 122), Color.FromArgb(237, 240, 247));
If you query for specific attributes in a cell and these attributes have not been explicitly set for the cell, the GridStyleInfo object that is returned by the indexer is smart enough to query base styles for queried information.
model.RowStyles[1].TextColor = Color.FromArgb(0, 21, 84);
Color color = model[1, 1].TextColor;
// model[1, 1].TextColor will return Color.FromArgb(0, 21, 84));
Item[String]
Gets or sets the row style information of a row.
Declaration
public GridStyleInfo this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Property Value
Type |
---|
GridStyleInfo |
SyncRoot
Declaration
public object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Methods
CopyTo(GridStyleInfo[], Int32)
Copies the GridModelColStylesIndexer elements to a one-dimensional System.Array at the specified index.
Declaration
public void CopyTo(GridStyleInfo[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo[] | array | The one-dimensional System.Array that is the destination of the System.Collections.DictionaryEntry objects copied from the GridModelColStylesIndexer instance. The System.Array must have zero-based indexing. |
System.Int32 | index | The zero-based index in |
GetEnumerator()
Returns an System.Collections.IEnumerator that can iterate through the column styles in the GridModelColStylesIndexer instance.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator for the GridModelColStylesIndexer instance. |
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 |