我在 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;
}
可能是什么问题?