传入字典的模型项的类型为'system.Collections.Generic.List'1 [System.String]',但字典是模型B

时间:2016-01-28 03:20:59

标签: list asp.net-mvc-4 combobox

我正在尝试使用performcallback创建一个创建组合框,但是我收到了错误。这里错误“ 传入字典的模型项的类型为'system.Collections.Generic.Lost'1 [System.String]',但是这个dix = ctionary需要一个'DIS_iDealer类型的模型项。 Models.SalesMonitoringModel'

我不知道我需要粘贴哪个代码,但这就是我所拥有的: 查看组合框:

@model  DIS_iDealer.Models.SalesMonitoringModel

@Html.DevExpress().ComboBoxFor(m => m.mpmGroupLine.DESCRIPTION, settings =>
{
    settings.Name = "Desc_ID_CB";
    settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
    settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
    settings.CallbackRouteValues = new { Controller = "Report", Action = "cbPartialCategoryDetail" };
    settings.Properties.CallbackPageSize = 50;
    settings.Properties.ValueField = "DESCRIPTION";
    settings.Properties.TextField = "DESCRIPTION";
    settings.Width = 150;
    settings.SelectedIndex = 0;

    settings.Properties.ClientSideEvents.BeginCallback = "function(s,e){e.customArgs['group_Id'] = Category_Id_CB.GetValue()}";
    settings.Properties.ValidationSettings.ErrorTextPosition = ErrorTextPosition.Right;
    settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
    settings.Properties.ValidationSettings.Display = Display.Dynamic;

}).BindList((List<string>)new DIS_iDealer.DataAccess.SalesMonitoringDAC().GetProductGroupDetail(Model.mpmGroupLine.GROUPID).ToList()).GetHtml()

控制器:

namespace DIS_iDealer.Controllers
{
    public class ReportController : BaseController
    {

[HttpGet]
        public ActionResult Report_SalesMonitoring_2()
        {
            SalesMonitoringModel mode = new SalesMonitoringModel();
            //MPMPRODUCTGROUPLINE itemB = new MPMPRODUCTGROUPLINE();
            /*List<string> mpmCate = mode.GetProductGroup();
            if (mpmCate != null)
            {
                itemB.DESCRIPTION = mode.mpmGroupLine.DESCRIPTION;
            }*/
            ReportModels modelReport = new ReportModels();
            if (TempData["ReportSalesMonitoring2"] != null)
            {
                modelReport = (ReportModels)TempData["ReportSalesMonitoring2"];
                string reportParam = string.Empty;
                foreach (string item in modelReport.ParameterReport)
                {
                    reportParam += item;
                }
                ViewBag.IframeURL = modelReport.WebURL + reportParam;
            }
            return View(mode);
        }

[ValidateInput(false)]
        public ActionResult cbPartialCategoryDetail(string group_Id)
        {
            //SalesMonitoringModel model = new SalesMonitoringModel();
            SalesMonitoringDAC model = new SalesMonitoringDAC();
            List<string> itemDetail = model.GetProductGroupDetail(group_Id);

            return PartialView("_cbPartialCategoryDetail", itemDetail);
        }
}
}

如果您需要更多信息,请与我们联系。感谢。

0 个答案:

没有答案