与数据感知控制绑定的应是数据集代理对应的数据集
可以用下面方法在窗体中得到与指定数据集绑定的感知控制:
var
i : Integer;
s : string;
DataSource : TDataSource;
begin
for i := 0 to ComponentCount - 1 do
begin
if Components is TDataNavigator then
begin
DataSource := TBizDataSetAction(TDataNavigator(Components).Buttons[0].Action).CurrentDataSource;
if DataSource <> nil then
begin
s := DataSource.DataSet.Name;
if s = '数据集ID' then Dialogs.ShowMessage('OK,找到了');
end;
end;
end;