0

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;
}

考えられる問題は何ですか?

4

1 に答える 1

0

この例が役立つと思います。 最初のルックアップ列の値に基づいて2番目のルックアップ列をフィルタリングする方法

于 2012-08-08T04:57:09.287 に答える