关于DBGRIDEH (代码)多选

先把多选dgMultiSelect设置成True;
procedure TForm1.Button1Click(Sender: TObject);
var
   I:integer;
begin
       for I := 0 to 3 do
          begin
            if ADOTable1.Locate('ID',I*2,[]) then
                begin
                  DBGridEh1.SelectedRows.CurrentRowSelected:=true;
                end;
          end;
          ShowMessage(IntToStr(DBGridEh1.SelectedRows.Count));  这里显示为4个。
end;

你可能感兴趣的:(关于DBGRIDEH,(代码)多选)