RT,注意不是整行选择的,而上某一列从下到下选中了多个单元格,如何通过这些单元格获取到这一行的主键,

解决方案 »

  1.   

    最终自己解决了,散分了
      if self.DBGridEh1.Selection.SelectionType=gstRectangle then
      self.DBGridEh1.DataSource.DataSet.Book:=dbgridEh1.Selection.Rect.TopRow;  while not self.ADOQuery1.Eof do
      begin    if DBGridEh1.DataSource.Dataset.CompareBooks(TBook(DBGridEh1.Selection.Rect.BottomRow),
                    TBook(DBGridEh1.DataSource.DataSet.Book)) = 0 then Break;
        showMessage(self.ADOQuery1.FieldByName('a0188').Asstring);
        self.ADOQuery1.Next;
      end;