devexpress xtragrid コントロールに 3 つの lookupedit リポジトリ (3 つの列用) があります。lookupedit1 から選択した値に基づいて lookupedit2 をバインドし、lookupedit2 に基づいて lookupedit3 をバインドします。ルックアップ編集をクリックすると、入力された要素のみが表示されます。ただし、選択した要素はグリッドに表示されません。
これが私が使用したコードです:
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;
}
考えられる問題は何ですか?