【问题标题】:Binding LookupEdit Repository绑定查找编辑存储库
【发布时间】:2012-08-05 03:46:22
【问题描述】:

我在 devexpress xtragrid 控件中有三个 lookupedit 存储库(用于三列)。我想根据从lookupedit1和lookupedit3中选择的值绑定lookupedit2,基于lookupedit2。当我单击查找编辑时,我只能看到填充的元素。但是,它不会在网格上显示所选元素。

这是我使用的代码:

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

可能的问题是什么?

【问题讨论】:

    标签: data-binding devexpress xtragrid repositorylookupedit


    【解决方案1】:

    【讨论】:

    • 感谢 DmitryG 的及时回复。但是,它对我不起作用,因为我使用 LINQ 和存储过程来获取数据。可以给我一些示例代码吗?
    猜你喜欢
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-20
    • 2011-11-06
    • 2012-01-10
    • 1970-01-01
    相关资源
    最近更新 更多