我有订单实体,我可以在添加评论时选择运算符我在 OperatorViewModel 中的变量: public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; }订单控制器: var operatorComment = operatorRepository.Get(); var operatorCommentList = operatorComment.Select(opList => new OperatorViewModel { Id = opList.Id, FirstName = opList.FirstName }) .ToList(); ViewBag.AvailableOperatorComment = operatorCommentList;剑道专栏: columns.Bound(c => c.OperatorFirstName) .Title(T("Sales.Order.Operator")) .ClientTemplate($@"#= OperatorFirstName # #= OperatorLastName #") .EditorTemplateName("OperatorCommentList") .EditorViewData(new { AvailableOperator = ViewBag.AvailableOperatorComment });OperatorCommentList 模板:@model OperatorViewModel@{var orderOperatorCommentList = ViewData["AvailableOperator"] as List<OperatorViewModel>;}@(Html.Kendo().DropDownListFor(m => m) .DataValueField(nameof(OperatorViewModel.Id)) .DataTextField(nameof(OperatorViewModel.FirstName)) .BindTo(orderOperatorCommentList))在 OrderOperatorCommentViewModel 列表中:public List<SelectListItem> AvailableOperatorComment { get; set; }现在如何更改 dataTextField 以解析名字和姓氏?我想要名单上的名字和姓氏,但不知道该怎么做
1 回答
- 1 回答
- 0 关注
- 115 浏览
添加回答
举报
0/150
提交
取消