16
votes

I can go the long way round, loop over each row, get a TRect from CellRect(col, row), then query its State for gdSelected ...

But isn't there a quicker way to get the row number of the currently selected row, if any?

2
Note that your variable names are unfortunate, as they hide properties of the grid. For loop variables you should probably use something like RowIndex and ColIndex to avoid the problem.mghie

2 Answers

35
votes

.Row for selected row, .Col for selected column

14
votes

Please have a look at TStringGrid.Row.