Selection: IDataGridSelection;
The Selection property returns elements selection in the component.
Executing the example requires a form with the Button component on this form and the DataGrid component. These components must have the Button1 and DataGrid1 identifiers respectively.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
i: Integer;
Begin
i := DataGrid1.Selection.Count;
End Sub Button1OnClick;
After executing the example on clicking Button1 the "s" variable contains the number of rows selected in the DataGrid1 table.
See also: