Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting a row in TStringGrid from click on any cell within that row.

I have a TStringGrid object on a form which has 1 FixedCol and 1 FixedRow. I want to be able to select an entire row on the object when the user clicks on any cell within that row. This selection must also be visible to the user (I want the row to change colour).

EDIT: Have put goRowSelect in options on the object. Is there now a way to select the row on the click of one of the cells in the fixed column?

like image 436
Seryth Avatar asked Feb 28 '14 11:02

Seryth


Video Answer


1 Answers

In order highlight entire row when ever the user clicks on any cell in that row, set the following StringGrid properties.

In design time: Go to options property and check the following sub-properties.

goEditing := TRUE;
goRowSelect := TRUE;

To achieve this at run time,

StringGrid1.Options := StringGrid1.Options + [goEditing];
StringGrid1.Options := StringGrid1.Options + [goRowSelect];
like image 193
Hari Babu Mandala Avatar answered Sep 29 '22 20:09

Hari Babu Mandala