cxListView和dbgrid联动
时间:2021-07-01 10:21:17
帮助过:14人阅读
TForm1.FormCreate(Sender: TObject);
begin
ClientDataSet1.First;
while not ClientDataSet1.Eof
do
begin
with cxListView1.Items.Add
do
begin
caption := ClientDataSet1.Fields[
0].AsString;
SubItems.Add(ClientDataSet1.Fields[1].asstring);
end;
ClientDataSet1.Next;
end;
ClientDataSet2.Data :=
ClientDataSet1.Data;
ClientDataSet2.Close;
end;
procedure TForm1.cxListView1DblClick(Sender: TObject);
begin
ClientDataSet2.Filter :=
‘CustNo=‘ +
cxListView1.Items[cxListView1.ItemIndex].Caption;
ClientDataSet2.Filtered :=
True;
ClientDataSet2.Open;
end;
cxListView和dbgrid联动
标签: