在两个绑定到同一绑定源的devexpress网格控件之间取消关联行选择

时间:2013-09-09 18:05:15

标签: c# devexpress bindingsource gridcontrol

我创建了一个表单,其中包含GridControl,在实例化时绑定到BindingSource。我打算让用户能够同时打开此表单的多个实例,同时能够在不同的视图上应用不同的过滤器。这一切目前都很有效。我希望能够做的一件事是取消表单之间的行选择。当我单击一个GridControl中的一行时,在表单的所有其他实例中选择了相同的行。

有办法做到这一点吗?我不想创建BindingSource的副本,因为考虑到数据的复杂性和大小,必须管理所有这些源的任何源的更新将是一个真正的混乱。我可以将多个GridControl绑定到同一个BindingSource并且能够在它们之间单独选择行吗?

更新

我在Form的构造函数中调用此方法:

public virtual void UpdateDataSource()
{
    if (_dataFeatures != CurrentInspectionFile.BoundFeatureList)
    {
        gridControl1.BeginUpdate();
        _dataFeatures = CurrentInspectionFile.BoundFeatureList;
        DetachEventHandlers();
        AttachEventHandlers();
        gridControl1.EndUpdate();
    }

    SetFeatureDataBindings();

    gridControl1.DataSource = _dataFeatures;

    UpdateLookupLists();

    UpdateGridColumns();
}

_dataFeatures设置为BindingSource对象,该对象是BoundFeatureList属性的getter中的构造函数。每个Feature本身就是一个非常复杂的对象。

由于

0 个答案:

没有答案