TStringGrid - is there a simple way to get the "current/selected" row?

46,233

Solution 1

.Row for selected row, .Col for selected column

Solution 2

Please have a look at TStringGrid.Row.

Share:
46,233
Mawg says reinstate Monica
Author by

Mawg says reinstate Monica

Donate a cup of food for free: Click to Give @ The Hunger Site SOreadytohelp

Updated on October 31, 2020

Comments

  • Mawg says reinstate Monica
    Mawg says reinstate Monica over 3 years

    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?

  • Mawg says reinstate Monica
    Mawg says reinstate Monica over 14 years
    D'oh! How on earth did I miss that??? Thanks, both. Andre answered first, so I award him the answer and up you both. If only all questions were this easy, eh?