0

我在 devexpress xtragrid 控件中有三个查找编辑存储库(用于三列)。我想根据从lookupedit1和lookupedit3中选择的值绑定lookupedit2,基于lookupedit2。当我单击查找编辑时,我只能看到填充的元素。但是,它不会在网格上显示所选元素。

这是我使用的代码:

void repositoryLookupEdit1_EditValueChanged(object sender, EventArgs e) {
    LookUpEdit edit = gridView.ActiveEditor as LookUpEdit;
    int val = Convert.ToInt32(edit.EditValue);
    if (!val.Equals(0)) {
        var elements = from e in dc.Elements select e;
        repositoryLookupEdit1.DisplayMember = "paymentType";
        repositoryLookupEdit1.ValueMember = "paymentTypeID";
        repZone.DataSource = bindData(elements);  
    }
}
public BindingSource bindData(object obj) {
    BindingSource ctBinding = new BindingSource();
    ctBinding.DataSource = obj;
    return ctBinding;
}

可能是什么问题?

4

1 回答 1

0

我相信这个例子会有所帮助: How to filter the second LookUp column based on the first LookUp column's value

于 2012-08-08T04:57:09.287 回答