DBGridEh多选行

1.  将DbgridEh的Option里面的dgRowSelect和dgMultiSelect设为true,即可按住ctrl选择多行,但是这样的话不允许修改单元格
 选择多行时,操作所选择的行
      with ADOQryDetail do

        for i:=0 to (DBGridDetail.SelectedRows.Count - 1) do

 

        begin

 

          GotoBookmark(pointer(DBGridDetail.SelectedRows.Items[i])); 

 

       with ADOQryDetail do 

 

         begin

 

            First;

 

            while not Eof do

 

            begin

 

              ADOQryDetail.Edit; 

 

             ADOQryDetail.FieldByName(FieldByName('N_DATE_TYPE_D').AsString).AsString

 

               := FieldByName('N_REMARK').AsString;

 

              Next; 

 

           end;

 

         end;

 

        end;

你可能感兴趣的:(grid)