W wisdomphg Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-09 #1 delphi怎样把listbox与SQL的数据表A捆绑,使listbox有象excel一样有网格,并且从listbox1移到listbox2的数据不需刷新就能显示。谢谢各位大虾。
D duxing Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-09 #2 非要用listbox么~` 用DBGrid 不行么~`
Z znxia Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-09 #3 就是,把option设置为 Options = [dgEditing, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]就和你说的效果一样了。后面一句话不大明白,麻烦说详细点,以便于大家帮忙。
就是,把option设置为 Options = [dgEditing, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]就和你说的效果一样了。后面一句话不大明白,麻烦说详细点,以便于大家帮忙。
D duxing Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-09 #4 znxia 你好!请问下 options是ListBox属性么? 能详细讲解一下么~ 谢谢~
W wisdomphg Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-10 #6 znxia从degrid1选一个数,添加到degrid2中,degrid1中选中的数据要删除去,这个数据在degrid2中不刷新就能显示,如果degrid1全选就到degrid2中又怎么处理.
Z znxia Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-10 #8 dbgrid对应的dataset更改为clientdataset,对clientdataset进行数据删除和更改的时候,速度很快的。处理完成后,你再把数据保存到对应数据库即可。
Z znxia Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-10 #10 属性:query1 :原先对应于dbgrid1. query2:原先对应于dbgrid2新增:ClientDataSet1 ClientDataSet2 DataSetProvider1datasource1.dataset :=ClientDataSet1;dbgrid1.datasource := datasource1;datasource2.dataset :=ClientDataSet2;dbgrid2.datasource := datasource2;--------------------DBGrid1取数据代码query1.close;query1.sql.text:=_____________;query1.open;DataSetProvider1.DataSet:=query1;ClientDataSet1.close;ClientDataSet1.Data:= DataSetProvider1.Data;--------------------------------------------------dbgrid1-->dbgrid2代码:var I:Integer;begin if ClientDataSet1.RecordCount<=0 then exit; ClientDataSet2.Append; For i:=0 to ClientDataSet1.Fields.Count-1 do ClientDataSet2.Fields.Value:=ClientDataSet1.Fields.Value; ClientDataSet2.Post; ClientDataSet1.Delete;end;------------------最后如何处理这些数据,就是你的事情了。费了这么大力气,请记得结贴给分。
属性:query1 :原先对应于dbgrid1. query2:原先对应于dbgrid2新增:ClientDataSet1 ClientDataSet2 DataSetProvider1datasource1.dataset :=ClientDataSet1;dbgrid1.datasource := datasource1;datasource2.dataset :=ClientDataSet2;dbgrid2.datasource := datasource2;--------------------DBGrid1取数据代码query1.close;query1.sql.text:=_____________;query1.open;DataSetProvider1.DataSet:=query1;ClientDataSet1.close;ClientDataSet1.Data:= DataSetProvider1.Data;--------------------------------------------------dbgrid1-->dbgrid2代码:var I:Integer;begin if ClientDataSet1.RecordCount<=0 then exit; ClientDataSet2.Append; For i:=0 to ClientDataSet1.Fields.Count-1 do ClientDataSet2.Fields.Value:=ClientDataSet1.Fields.Value; ClientDataSet2.Post; ClientDataSet1.Delete;end;------------------最后如何处理这些数据,就是你的事情了。费了这么大力气,请记得结贴给分。
W wisdomphg Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-10 #11 znxia大侠你这代码不能运行,我用adoquery代替query行吗?