Bug with RealColIndex ?

Hi,
Delphi XE8,
TMS Component Pack 7.9.0.1

There seems to be a bug with grid.RealColIndex (in my case inside a OnGetDisplayText event).
It can be reproduced with the code included. Just run the project and notice that the sequence printed via OnGetDisplayText is wrong. It's skipping number 2 and giving number 4 twice.

Help would be appreciated.
Thanks

procedure TForm1.FormCreate(Sender: TObject);
var
   i: Integer;
begin
   AdvStringGrid1.FixedCols := 0;
   for i := 0 to AdvStringGrid1.ColCount - 1 do
   begin
      AdvStringGrid1.Ints[i, 1] := i;
   end;
   AdvStringGrid1.HideColumn(1);
end;

procedure TForm1.AdvStringGrid1GetDisplText(Sender: TObject; ACol, ARow: Integer; var Value: string);
begin
   if ARow = 2 then Value := AdvStringGrid1.RealColIndex(ACol).ToString;
end;

I also get a problem with HintShowLargeText that seems related.

You can reproduce using the following code with those steps:
Place your cursor on every cell showing 'aaaaaaaaaaaaaaaa' to get the hint to pop
Everything should be fine.
Now uncomment the line: AdvStringGrid1.HideColumn(0);
Place your cursor on every cell showing 'aaaaaaaaaaaaaaaa' to get the hint to pop
Notice the hint position is wrong.
Now uncomment the line: AdvStringGrid1.HideColumn(1);
Place your cursor on every cell showing 'aaaaaaaaaaaaaaaa' to get the hint to pop
Notice the hint position is very wrong. For the last cell the hint popt at the left side fo the grid.


procedure TForm1.FormCreate(Sender: TObject);
var
   i: Integer;
begin
   AdvStringGrid1.ShowHint := True;
   AdvStringGrid1.HintShowLargeText := True;
   AdvStringGrid1.FixedCols := 0;
   for i := 0 to AdvStringGrid1.ColCount - 1 do
   begin
      AdvStringGrid1.Ints[i, 1] := i;
   end;
   //AdvStringGrid1.HideColumn(0);
   //AdvStringGrid1.HideColumn(1);
end;

procedure TForm1.AdvStringGrid1GetDisplText(Sender: TObject; ACol, ARow: Integer; var Value: string);
begin
   if ARow = 2 then Value := AdvStringGrid1.RealColIndex(ACol).ToString;
   if ARow = 3 then Value := 'aaaaaaaaaaaaaaaa';
end;

  1. The ACol parameter is already the real column index
    2) We fixed the issue with the positioning of the large text hint

If the ACol parameter is already the real column index, can you explain why it shows "4" twice in the example code I gave you?

I do not understand.

Thanks

If you call RealColIndex() on an index that is already a real column index, it goes wrong.

The result is correct with:


procedure TForm1.AdvStringGrid1GetDisplText(Sender: TObject; ACol, ARow: Integer; var Value: string);
begin
   if ARow = 2 then Value := ACol.ToString;
end;