At this point, to tell if I need to paint a row differently because it's a table name, I loop through all the rows, check that the first (hidden) cell is painted green, and paint all the cells of the current row that way. I'd rather use something a bit smarter if possible.
A grid doesn't have the Tag property, so is there an alternative way to easily retrieve some rows by tagging them? I see the properties "Data" and "Level". What are they used for?
Here's what it looks like, and here's the code I use:
CODE
With NextGrid4 do begin
CellsByName['sql',0] := 'table1';
CellsByName['key',0] := 'Table 1';
//"Table" row = 1, "column" row = 0
//Row[0].Tag := 1
//Row[0].Data
//Row[0].Level
Cell[ColumnByName['sql'].Index,0].Color := clMoneyGreen;
CellsByName['sql',1] := 'article.id';
CellsByName['key',1] := 'Article ID';
CellsByName['value',1] := '123';
for myrow := 0 to RowCount - 1 do begin
//Poor man's way to check what type of row it is :-/
if Cell[0,myrow].Color = clMoneyGreen then begin
for mycol := 0 to Columns.Count - 1 do begin
Cell[mycol,myrow].Color := clMoneyGreen;
end;
end;
end;
end;
CellsByName['sql',0] := 'table1';
CellsByName['key',0] := 'Table 1';
//"Table" row = 1, "column" row = 0
//Row[0].Tag := 1
//Row[0].Data
//Row[0].Level
Cell[ColumnByName['sql'].Index,0].Color := clMoneyGreen;
CellsByName['sql',1] := 'article.id';
CellsByName['key',1] := 'Article ID';
CellsByName['value',1] := '123';
for myrow := 0 to RowCount - 1 do begin
//Poor man's way to check what type of row it is :-/
if Cell[0,myrow].Color = clMoneyGreen then begin
for mycol := 0 to Columns.Count - 1 do begin
Cell[mycol,myrow].Color := clMoneyGreen;
end;
end;
end;
end;
Thank you.