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