DevExpress MVC ComboBox在提交时使用TextField而不是ValueField

时间:2013-07-24 13:11:56

标签: c# asp.net-mvc devexpress

我在视图中使用了DevExpress.ComboBoxFor。

@using (Ajax.BeginForm(actionName: "DetailPartialAction", controllerName: "CeduleDepartementale", ajaxOptions: new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "target" }))
{
  @Html.DevExpress().LabelFor(x => x.CeduleDateFrom) 
  @Html.EditorFor(x => x.CeduleDateFrom) 
  @Html.LabelFor(x => x.CeduleDateTo) 
  @Html.EditorFor(x => x.CeduleDateTo) 
  @Html.LabelFor(x => x.WorkCenter) 
  @Html.DevExpress().ComboBoxFor(x => x.WorkCenter, 
  settings => 
               { 
                 settings.Name = "WorkCenter"; 
                 settings.Width = 180; 
                 settings.SelectedIndex = 0; 
                 settings.Properties.TextField = "Name"; 
                 settings.Properties.ValueField = "No"; 
                 settings.Properties.ValueType = typeof (string); 
}).BindList(CeduleProduction.Repository.Concrete.WorkCenterRepository
.GetAll()).GetHtml() 

<input type="submit" value="OK"/>}

当我提交表单时,不使用valuefield,它是textfield,我需要更改以允许传递值(未显示)而不是显示的文本字段

0 个答案:

没有答案