Item Property (GridModel)

Gets or sets the style information of a cell.
Public Default Property Item( _
   ByVal rowIndex As Integer, _
   ByVal colIndex As Integer _
) As GridStyleInfo
Dim instance As GridModel
Dim rowIndex As Integer
Dim colIndex As Integer
Dim value As GridStyleInfo
instance.Item(rowIndex, colIndex) = value
value = instance.Item(rowIndex, colIndex)
public GridStyleInfo this[ 
   int rowIndex,
   int colIndex
]; {get; set;}


The indexer provides you with a very simple way to query and change cell contents.
The following example make some changes to the grid using the indexer: 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[2, 2].Text = "Grid Demo";
model[2, 2].Font.Bold = true;
model[2, 2].Font.Size = 16;
model[2, 2].HorizontalAlignment = GridHorizontalAlignment.Center;
model[2, 2].VerticalAlignment = GridVerticalAlignment.Middle;
model[2, 2].CellType = "Static";
model[2, 2].Borders.All = new GridBorder(GridBorderStyle.Solid, Color.FromArgb(100, 238, 122, 3));
model[2, 2].Interior = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(100, 57, 73, 122), Color.FromArgb(237, 240, 247));
GridStyleInfo standard = model.BaseStylesMap["Standard"].StyleInfo;
standard.TextColor = Color.FromArgb(0, 21, 84);
    Color color = model[1, 1].TextColor;
    // model[1, 1].TextColor will return Color.FromArgb(0, 21, 84));

Syncfusion.Grid.Windows: 17.3460.0.26

See Also