(有可能是连续的,有可能是隔了其他记录的 ) Var 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; 1.绑定数据 方法 cxGrid1DBTableView1.DataController.DataSource:=DataSource1 2.去掉"Drag a column header here to group by that column" 方法 cxGrid1DBTableView1.OptionsView.GroupByBox置为False 3.去掉表头下三角数据 方法 cxGrid1DBTableView1.Optionscustomize.columnfiltering置为False 4.增加序号 方法 在dataset 里边增加 Mycount 字段 类型为 string 在 CXgrid 增加显示字段 序号 mycount 为该字段写事件 procedure Tfrm_form.ReDataSet2mycountGetText(Sender: TField; var Text: String; DisplayText: Boolean);