小编San*_*bhu的帖子

在nopcommerce 2.8中使用Telerik插件的自定义网格

我正在研究nopcommerce2.8版本.我有一个telerik插件实现的问题来创建新的网格.我实施了一个概念,我希望为不同的客户提供不同价格的产品.因此,要为不同的客户分配新价格,请在管理面板中使用telerik在编辑产品变量页面中创建网格.我创建了一个新选项卡来显示这些详细信息.我能够在网格中显示客户名称和价格,但是当我在编辑一行后点击更新按钮时,我无法调用更新功能.同样的更新功能我也要求删除网格行,所以当我点击删除相同的更新功能获取触发器.我认为在View中错过了一些设置.请帮我解决这个更新问题.

我的nopcommerce的模型,视图和控制器如下所示.

谢谢.

//Model
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using FluentValidation.Attributes;
using Nop.Admin.Models.Customers;
using Nop.Admin.Validators.Catalog;
using Nop.Web.Framework;
using Nop.Web.Framework.Localization;
using Nop.Web.Framework.Mvc;
using Telerik.Web.Mvc;

namespace Nop.Admin.Models.Catalog
{
    public partial class CustomerProductPriceModel : BaseNopModel
    {
        public int Customer_Id { get; set; }
        [NopResourceDisplayName("Customer Name")]
        public string Customer_name { get; set; }

        [NopResourceDisplayName("Price")]
        public decimal Price { get; set; }

        [NopResourceDisplayName("Unit")]
        public string Units { get; set; }

    }
}

// view

  @(Html.Telerik().Grid<CustomerProductPriceModel>()
        .Name("Grid")
        .DataKeys(x =>
                    {
                        x.Add(y => y.Customer_Id);
                    })
                     .DataBinding(dataBinding …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc telerik nopcommerce telerik-mvc telerik-grid

5
推荐指数
1
解决办法
598
查看次数