Ah, OK. In that case, call neither the inherited
SelectCell or
OnSelectCell if the cell is empty:
Result := not Cells[ACol, ARow].Trim.IsEmpty
and inherited SelectCell(ACol, ARow);
In the normal state, with short-circuit evaluation on, that will first check whether:
Cells[ACol, ARow].Trim.IsEmpty = Trueand if so, because the
not, it'll result False, in which case the
and would result in False and there is no need to evaluate (or execute) the inherited
SelectCell().
Also, there is no need to test and call
OnSelectCell since the ancestor
SelectCell() in
TCustomDrawGrid already does it.
Note that I have
not tested this so it might not work ... though it should if all else is right.
HTH!