Имам три репозитория за търсене (за три колони) в контрола devexpress xtragrid. Искам да обвържа lookupedit2 въз основа на стойност, избрана от lookupedit1 и lookupedit3 въз основа на lookupedit2. Мога да видя попълнените елементи само когато щракна върху 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;
}
Какъв може да е евентуалният проблем?