我在一个devexpress xtragrid控件中有三个lookupedit存储库(三列)。我想根据从lookupedit1中选择的值绑定lookupedit2,并基于lookupedit2绑定lookupedit3。当我单击lookupedit时,我只能看到填充的元素。但是,它不会在网格上显示选定的元素。
下面是我使用的代码:
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;
}可能的问题是什么?
发布于 2012-08-08 12:57:09
我相信这个例子会很有帮助:How to filter a second LookUp column based on a first LookUp column's value
https://stackoverflow.com/questions/11857642
复制相似问题