[cxGrid] Change Multi-Selected Records
来源:互联网 发布:怎么在淘宝上买电棍 编辑:程序博客网 时间:2024/06/05 03:56
//0.Search Manual: TcxCustomDataController.ForEachRow
//1. set properties for multi-selection
----------------------------------------------------------
MainGridView.OptionsSelection.MultiSelect := true;
MainGridView.DataController.KeyFieldNames := 'SONo';
FSelectSONoList := TStringList.Create;
----------------------------------------------------------
//2.prepare a callback function to save what you would selected
----------------------------------------------------------
procedure TfrmSOSchedule.SaveSelectedSO(ARowIndex: Integer;
ARowInfo: TcxRowInfo);
begin
with MainGridView.DataController do
begin
//test whether a row is a data record
if ARowInfo.Level = Groups.GroupingItemCount then
FSelectSONoList.Add(String(GetRecordId(ARowInfo.RecordIndex)));
end;
end;
----------------------------------------------------------
//3.use the selected entries
----------------------------------------------------------
procedure TfrmSOSchedule.btnUpdateSelectedSOClick(Sender: TObject);
var
i: Integer;
begin
FSelectSONoList.BeginUpdate;
try
FSelectSONoList.Clear;
MainGridView.DataController.ForEachRow(true, SaveSelectedSO);
finally
FSelectSONoList.EndUpdate;
end;
with MainGridView.DataController.DataSource.DataSet do
begin
DisableControls;
try
for i := 0 to FSelectSONoList.Count - 1 do
begin
if Locate('SONo', FSelectSONoList[i], []) then
FindField('status').AsInteger := 1;
end;
finally
PostSaleOrders;
EnableControls;
end;
end;
end;
- [cxGrid] Change Multi-Selected Records
- Change table records with SE16N
- Records
- Records
- cxgrid
- Change Rows Background color in GridView with selected Criteria
- Get Selected Row Values From Kendo Grid On Change Event
- selected
- How to change the text color of the selected property sheet tab in Visual C++
- moss records
- Audit Records
- some records
- temp records
- records.config
- theano records
- Bug records
- change
- Change
- asp.net 錯誤分析
- 关于Tomcat虚拟主机域名的设置
- 教你如何制作网页木马
- 管理小故事 100例
- 我的股票:2007/05/16 净值:1.7147
- [cxGrid] Change Multi-Selected Records
- FTP匿名入侵
- 教你知道了别人IP如何入侵别人的电脑
- SQL*Loader工作机制以及实例
- ceshi
- Javascript的interval绑定方法,每隔两秒执行该方法
- ASP实现自动换行功能
- 网站设计常用技巧
- 斯比亚之名