我有一个
TWebTableControl
,我需要将数据加载到其中,但我不明白如何执行此操作。
我也不理解文档:https://download.tmssoftware.com/doc/tmswebcore/components/twebtablecontrol/
它说要使用
TableControl.Cells[col,row]: string;
,但是怎么用呢?
我的桌子的名字是
tblCoupons
。我不知道如何将数据加载到该表中。有人可以帮忙提供代码示例或指南吗?
这是将数据放入
TWebTableControl
的代码示例:
var
I: UInt64;
begin
TableControl.ColCount := 4;
TableControl.RowCount := 1;
TableControl.Cells[0,0] := 'First Column Heading';
TableControl.Cells[1,0] := 'Second Column Heading';
TableControl.Cells[2,0] := 'Third Column Heading';
TableControl.Cells[3,0] := 'Fourth Column Heading';
For I := 1 to 10 do
begin
TableControl.RowCount := TableControl.RowCount + 1;
TableControl.Cells[0,I] := 'Random Data col_1 for Row ' + I.ToString;
TableControl.Cells[1,I] := 'Random Data col_2 for Row ' + I.ToString;
TableControl.Cells[2,I] := 'Random Data col_3 for Row ' + I.ToString;
TableControl.Cells[3,I] := 'Random Data col_4 for Row ' + I.ToString;
end;
end;
TableControl
是表格组件的名称。
这就是上面的代码将在默认的
TWebTableControl
组件中生成的内容: