cxListView和dbgrid联动
procedure 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;
本文来自博客园,作者:liessay,转载请注明原文链接:https://www.cnblogs.com/liessay/p/5590557.html