L LanHer Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-26 #1 dxDBGrid中,如果我选择了1、3、4。。。。等行,我如何得到这些行的信息,也就是我要 对选择的行做操作,如何知道我选择的是1、3、4。。。行? 请dxDBGrid的高手指点一二,谢谢了!
V vine Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-26 #3 例子: procedure TForm1.Button1Click(Sender: TObject); var I: Integer; BookmarkList: TBookmarkList; Bookmark: TBookmark; begin Bookmark := Table1.GetBookmark; try ListBox1.Items.Clear; BookmarkList := DbGrid1.SelectedRows; for I := 0 to BookmarkList.Count - 1 do begin Table1.GotoBookmark (Pointer (BookmarkList )); ListBox1.Items.Add (Table1.FieldByName ( 'Name').AsString); end; finally Table1.GotoBookmark (Bookmark); Table1.FreeBookmark (Bookmark); end; end;
例子: procedure TForm1.Button1Click(Sender: TObject); var I: Integer; BookmarkList: TBookmarkList; Bookmark: TBookmark; begin Bookmark := Table1.GetBookmark; try ListBox1.Items.Clear; BookmarkList := DbGrid1.SelectedRows; for I := 0 to BookmarkList.Count - 1 do begin Table1.GotoBookmark (Pointer (BookmarkList )); ListBox1.Items.Add (Table1.FieldByName ( 'Name').AsString); end; finally Table1.GotoBookmark (Bookmark); Table1.FreeBookmark (Bookmark); end; end;
Z zhanzehua Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-26 #4 0<=i < dxDBGrid1->SelectedCount dxDBGrid1.SelectedNodes