TDBGride中如何用shift键选中多行记录??
TDBGride中如何用shift键选中多行记录??
TDBGride中可以用Ctrl键选中多行记录!
按住shift键和上下方向键组合可实现选择多条记录,前提是DBGrid的Options属性除前两项false,其他均true
[此贴子已经被作者于2004-05-26 11:31:07编辑过]
var bookmarklist :tbookmarklist; bookmark : tbookmarkstr;
bookmark :=table1.bookmark; try listbox1.items.clear; bookmarklist :=dbgrid1.selectedrows; for i :=0 to bookmarklist.count-1 do begin adotable1.bookmark :=bookmarklist[i]; listbox1.items.add(adotable1.fieldbyname(' ').asstring; end; finally adotable1.bookmark :=bookmark; end; end;
遍历所选记录