0
在devexpress xtragrid控件中,我有三个lookupedit存储库(用于三列)。我想根据从lookupedit1中选择的值和基于lookupedit2的lookupedit3来绑定lookupedit2。当我点击lookupedit时,我只能看到填充的元素。但是,它不会在网格上显示选定的元素。Binding LookupEdit Repository
这里是我使用的代码:
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;
}
可能是什么可能出现的问题?
谢谢DmitryG的迅速回应。但是,它不适用于我,因为我使用LINQ和存储过程来获取数据。你能给我提供一些样品代码吗? – aby 2012-08-08 12:51:21