Represent cell location (column and row index) as
property Location: TPoint read GetLocation;
Location is not re-calculated on each access to this property, instead it is set after calling Cell array property of Grid. If you use this property immediately after accessing Cell property there will be no issues and code will be fast.
In this situations there may be problems:
var MyCell: TNxCell6; MyRowVar: Integer; begin MyRowVar := NextGrid61.SelectedRow; MyCell := NextGrid61.Cell[0, MyRowVar]; // Drastic data changes NextGrid61.Columns.Sorted := True; // Cell is maybe not at the same position now if MyCell.Location.Y = MyRowVar then ...
To force re-calculation, use ComputedLocation property instead.
This property is TPoint combination of ColIndex and RowIndex properties:
function TNxCell6.GetLocation: TPoint; begin Result := Point(ColIndex, RowIndex); end;