Good morning,
I have a grid with m columns (all visible) and n rows (only some visible) filled with data. Some fields are too small to display the entire content, so I want to add a comment to these cells.
......
row := 1; // first row is Header
while ....
begin
for col := 0 to m - 1 do
begin
Grid.Cells[col,row] :=
xyCell := Grid.GetCellObject((MakeCell(col,row)));
if xyCell <> nil then
begin
textw := Grid.Canvas.TextWidth(Grid.Cells[col, row]);
colw := Grid.ColumnWidths[col];
if textw > colw then
Grid.Comments[col,row] := ;
end;
end;
Inc(row);
end;
.....
It looks like xyCell=nil for non-visible rows.
- How can I add a comment to all cells, even the non-visible ones?
- If only visible cells can be commented, how can I do this when the vertical scrollbar is moved?
- The calculation of the actual text width of a string in a cell and the comparison with the column width does not work reliably.
Thank you for help.