8

我在视图中使用 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 ,我必须更改什么以允许传递值(未显示)而不是显示的 textfield

4

0 回答 0