多選:
Procedure MutiSelect(Grid:TDBGrid);
begin
Grid.DataSource.DataSet.First;
While not Grid.DataSource.DataSet.Eof Do
begin
If Not Grid.SelectedRows.CurrentRowSelected then
Grid.SelectedRows.CurrentRowSelected:=True;
Grid.DataSource.DataSet.Next;
end;
end;
操作:
Procedure MutiSelectOp(Grid:TDBGrid);
var
i:integer;
begin
If dgMultiSelect in Grid.Options then
For i:=0 to Grid.SelectedRows.Count-1 Do
begin
Grid.DataSource.Dataset.GotoBook(Pointer(Grid.SelectedRows.Items[i]));
//此處對Grid.DataSource.Dataset進行處理
end;
end;
Procedure MutiSelect(Grid:TDBGrid);
begin
Grid.DataSource.DataSet.First;
While not Grid.DataSource.DataSet.Eof Do
begin
If Not Grid.SelectedRows.CurrentRowSelected then
Grid.SelectedRows.CurrentRowSelected:=True;
Grid.DataSource.DataSet.Next;
end;
end;
操作:
Procedure MutiSelectOp(Grid:TDBGrid);
var
i:integer;
begin
If dgMultiSelect in Grid.Options then
For i:=0 to Grid.SelectedRows.Count-1 Do
begin
Grid.DataSource.Dataset.GotoBook(Pointer(Grid.SelectedRows.Items[i]));
//此處對Grid.DataSource.Dataset進行處理
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货