2012-08-08 27 views
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; 
} 

可能是什麼可能出現的問題?

回答