DevExpress编辑模板组合框值到参数

DevExpress编辑模板组合框值到参数,devexpress,Devexpress,我有两个预先填充的组合框,其中值=“ID”和文本=相关数据 我正在网格视图中进行编辑,并调整了模板,使其具有两个组合框(每个相关字段都有自己的组合框) 我到处找,我想这很容易,人们甚至都不问。。。但是,如果在下面看到组合框,则不会使用组合框的值填充参数 所以我试过这个: protected void aspxGridviewUsers_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)

我有两个预先填充的组合框,其中
=“ID”和
文本
=相关数据

我正在网格视图中进行编辑,并调整了模板,使其具有两个组合框(每个相关字段都有自己的组合框)

我到处找,我想这很容易,人们甚至都不问。。。但是,如果在下面看到组合框,则不会使用组合框的值填充参数

所以我试过这个:

    protected void aspxGridviewUsers_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        e.NewValues["StoreID"] = GetStoreID();
        e.NewValues["GroupID"] = GetGroupID();

    }
    protected int GetStoreID()
    {
        ASPxComboBox CBID = new ASPxComboBox();
        CBID = aspxGridviewUsers.FindEditFormTemplateControl("ASPxComboBoxStoreEdit") as ASPxComboBox;
        return Convert.ToInt32(CBID.SelectedItem.Value.ToString());
    }
    protected int GetGroupID()
    {
        ASPxComboBox CBID = new ASPxComboBox();
        CBID = aspxGridviewUsers.FindEditFormTemplateControl("ASPxComboBoxGroupEdit") as ASPxComboBox;
        return Convert.ToInt32(CBID.SelectedItem.Value.ToString());
    }
这不起作用。我做错了什么


我如何使用组合框中的这些值来根据我的update语句进行更新?

我建议您使用以下代码:

返回Convert.ToInt32(CBID.Value)

代码。对你有用吗