Topic: TableGrid Alternating Row Colour Procedure
Hello.
I've created two procedures. ShowAlternateRowColours and ClearAlternateRowColours. They turn on/turn off alternating row colours in a TableGrid. As I want to use these procedures for all TableGrids I create, how can I call these procedures and pass them a tablegrid object? Ideally, it would look something like the code stub below. I'm fairly certain I'll need to instantiate a TableGrid object and pass that into the procedure, but I don't know how to do that. Many thanks.
procedure ShowAlternateRowColours(<TableGrid>);
var
i,k: integer;
begin
for i := 0 to frmExpenseDS.<TableGrid>.RowCount - 1 do
begin
for k := 0 to frmExpenseDS.<TableGrid>.Columns.Count - 1 do
begin
frmExpenseDS.<TableGrid>.Cell[k,i].Color := $00F0F0F0;
end;
end;
end;