我想把cxgrid多选 有可能是连续的 有可能是隔了其他记录的
在cxgrid中 把 cxGrid1DBTableView1 的 optionselection 中的multiselect设为true就可以了我要修改
选中的记录中一个字段我的代码是
procedure TF_genghuanyewuyuan.cxButton2Click(Sender: TObject);
var i:integer;
begin
if Application.MessageBox('确定要更换业务员吗?','警告!!',mb_yesno+mb_iconquestion+mb_defbutton2)=ID_YES then
begin
adoquery2.RecNo:=cxGrid1DBTableView1.DataController.RecNo;
for i:=0 to cxGrid1DBTableView1.DataController.Controller.SelectedRecordCount-1 do
begin
adoquery2.Edit;
adoquery2.FieldByName('业务员').Value:=cxcombobox4.Text;
adoquery2.Post;
adoquery2.Next;
end;
end;
end;但是 所改的 非我所选的
谢谢 大虾帮助
在cxgrid中 把 cxGrid1DBTableView1 的 optionselection 中的multiselect设为true就可以了我要修改
选中的记录中一个字段我的代码是
procedure TF_genghuanyewuyuan.cxButton2Click(Sender: TObject);
var i:integer;
begin
if Application.MessageBox('确定要更换业务员吗?','警告!!',mb_yesno+mb_iconquestion+mb_defbutton2)=ID_YES then
begin
adoquery2.RecNo:=cxGrid1DBTableView1.DataController.RecNo;
for i:=0 to cxGrid1DBTableView1.DataController.Controller.SelectedRecordCount-1 do
begin
adoquery2.Edit;
adoquery2.FieldByName('业务员').Value:=cxcombobox4.Text;
adoquery2.Post;
adoquery2.Next;
end;
end;
end;但是 所改的 非我所选的
谢谢 大虾帮助
解决方案 »
- lywho(阿勇) ,CROSSER进来
- 小妹请各位帮帮忙,问题简单,在线等待!!!
- 如何在DBRID中取得当前选中行的各列数据?
- delphi中异库数据记录如何互相导数?
- Rave 高手请进,万分感谢!
- 急!在线等,散分儿了!
- 数据库查询问题,请各位帮忙!!!
- 如何在报表中生成柱形图,波形图等,请给个实例?
- /*****************junglerover(灌木丛)的问题:为什么在ACTIVEX控件中不能使用普通FORM(TFORM)?*********************/
- 用delphi调用execl,如何打开一个已存在的execl文件?有分
- 关于软件工程硕士的问题
- 請問在水晶報表裡如何在formula fields裡創建新的頁
var i:integer;
begin
if Application.MessageBox('确定要更换业务员吗?','警告!!',mb_yesno+mb_iconquestion+mb_defbutton2)=ID_YES then
begin
adoquery2.RecNo:=cxGrid1DBTableView1.DataController.RecNo;
adoquery2.Edit;
for i:=0 to cxGrid1DBTableView1.DataController.Controller.RecordCount-1 do
begin
if cxGrid1DBTableView1.DataController.Controller.selected then //判断该记录是否被选
adoquery2.FieldByName('业务员').Value:=cxcombobox4.Text;
adoquery2.Next;
end;
adoquery2.Post;
end;
end;
//我没有该控件,不知道属性在什么下面,上面的语句可能要修改一下,不过意思你应该明白.
procedure TF_genghuanyewuyuan.cxButton2Click(Sender: TObject);
var i:integer;
begin
if Application.MessageBox('确定要更换业务员吗?','警告!!',mb_yesno+mb_iconquestion+mb_defbutton2)=ID_YES then
begin
with cxgrid1.DataSource.DataSet do
begin
for i := 0 to cxgrid1.SelectedRows.Count-1 do
begin
GotoBook(Pointer(cxgrid1.SelectedRows.Items[i]));
edit;
FieldByName('业务员').Value:=cxcombobox4.Text;
Post;
end;
end;
我就是不能确定
if cxGrid1DBTableView1.DataController.Controller.selected then //判断该记录是否被选
这句是错的 在cxgrid中到底有没有
有 怎么写
GotoBook(Pointer(cxgrid1.SelectedRows.Items[i]));
这个也不知道怎么写
假如是 普通的grid 我到是能搞定
大家能不能帮我看看
cxgrid
begin
for i := 0 to GetSelectedCount - 1 do
begin
DataSet.Book:=GetSelectedBook(i);
//Do ..........................
end;
http://soft.0zones.com/SoftView/SoftView_20939.html
试一试能不能找到你要的.
begin
for i := 0 to GetSelectedCount - 1 do
begin
DataSet.Book:=GetSelectedBook(i);
//Do ..........................
end;上面的代码就可以检索到所有被选中的行啊?
with cxgrid_GridView.DataController do
begin
for i := 0 to GetSelectedCount - 1 do
begin
DataSet.Edit;
DataSet.Book:=GetSelectedBook(i);
DataSet.FieldByName('业务员').Value:=cxcombobox4.Text;
end;
end;
with cxgrid_GridView.DataController do
begin
for i := 0 to GetSelectedCount - 1 do
begin
DataSet.Book:=GetSelectedBook(i);
DataSet.Edit;
DataSet.FieldByName('业务员').Value:=cxcombobox4.Text;
end;
end;
datacontroller not in gridmod的错误
i:integer;
以下立即搞定请给分!
begin
For i:=0 To cxGrid1DBTableView1.Controller.SelectedROwCount-1 Do
begin
cxGrid1dbtableview1.Controller.FocusedRow:=cxGrid1dbtableview1.Controller.SelectedRows[i];
Adoquery1.Edit;
Adoquery1.FieldByName('DeptName').AsString:=Edit1.Text
Adoquery1.Post;
end;
end;
GridView.DataController.DataModeController.GridMode=True;