IDataGridRow.StyleIndex

Syntax

StyleIndex: Integer;

Description

The StyleIndex property determines the style index for the current row from the collection of set styles of the DataGrid component.

Example

Executing the example requires a form, a button named Button1 on the form and the DataGrid component named DataGrid1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    s: IDataGridStyle;
Begin
    s := DataGrid1.Styles.Add;
    s.BackgroundColor := GxColor.FromName("Red");
    s.TextColor := GxColor.FromName("Green");
    DataGrid1.Rows.Item(0).StyleIndex := 1;
End Sub Button1OnClick;

After executing the example, on clicking the button the style is added to the styles collection and is applied to the first row.

See also:

IDataGridRow