If you change TNxCustomGridControl.GetCellByVariant in NxCustomGridControl.pas to the following code you get a much more usefull message during development:
Btw don't forget to add the 'Variants' unit to the implementation sections uses clause too.
CODE
function TNxCustomGridControl.GetCellByVariant(ACol,
ARow: Variant): TPoint;
begin
if CompareText(ARow, 'First') = 0 then
Result.Y := 0
else if CompareText(ARow, 'Last') = 0 then
Result.Y := Pred(RowCount)
else if CompareText(ARow, 'Selected') = 0 then
Result.Y := SelectedRow
else
try
Result.Y := ARow;
except
raise Exception.CreateFmt('Invalid Rowname '#39'%s'#39' for '#39'%s:%s'#39'.', [VarToStr(ARow), Self.ClassName, Self.Name]);
end;
if CompareText(ACol, 'First') = 0 then
Result.X := 0
else if CompareText(ACol, 'Last') = 0 then
Result.X := Pred(Columns.Count)
else if CompareText(ACol, 'Selected') = 0 then
Result.X := SelectedColumn
else if Columns.Column[ACol] <> nil then
Result.X := Columns.Column[ACol].Index
else
try
Result.X := ACol;
except
raise Exception.CreateFmt('Invalid Columnname '#39'%s'#39' for '#39'%s:%s'#39'.', [VarToStr(ACol), Self.ClassName, Self.Name]);
end;
end;
ARow: Variant): TPoint;
begin
if CompareText(ARow, 'First') = 0 then
Result.Y := 0
else if CompareText(ARow, 'Last') = 0 then
Result.Y := Pred(RowCount)
else if CompareText(ARow, 'Selected') = 0 then
Result.Y := SelectedRow
else
try
Result.Y := ARow;
except
raise Exception.CreateFmt('Invalid Rowname '#39'%s'#39' for '#39'%s:%s'#39'.', [VarToStr(ARow), Self.ClassName, Self.Name]);
end;
if CompareText(ACol, 'First') = 0 then
Result.X := 0
else if CompareText(ACol, 'Last') = 0 then
Result.X := Pred(Columns.Count)
else if CompareText(ACol, 'Selected') = 0 then
Result.X := SelectedColumn
else if Columns.Column[ACol] <> nil then
Result.X := Columns.Column[ACol].Index
else
try
Result.X := ACol;
except
raise Exception.CreateFmt('Invalid Columnname '#39'%s'#39' for '#39'%s:%s'#39'.', [VarToStr(ACol), Self.ClassName, Self.Name]);
end;
end;