对DBGrid中数据哭进行全选择,本人使用的方法:
with DBGrid.Datasource.dataset do
begin
First;
while not Eof do
begin
DBGrid.SelectedRows.CurrentRowSelected := True;
next;
end;
end;但数据太多,这样一条一条选中不是我想要的结果,请问有SelectAll这功能呢,谢谢!
with DBGrid.Datasource.dataset do
begin
First;
while not Eof do
begin
DBGrid.SelectedRows.CurrentRowSelected := True;
next;
end;
end;但数据太多,这样一条一条选中不是我想要的结果,请问有SelectAll这功能呢,谢谢!
不都是显示数据的吗?
TDataSet* ds = DBGrid1->DataSource->DataSet;
TBookList* Book = DBGrid1->SelectedRows;
Book->Clear();
ds->First();
ds->DisableControls();
while(!ds->Eof)
{
Book->CurrentRowSelected = true;
ds->Next();
}
ds->EnableControls();