9

I use a DevExpress.ComboBoxFor in a view.

@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"/>}

When I submit the form, the valuefield is not used , it's the textfield , what do I have to change to allow the value (not shown) to be passed and not the textfield which is shown

Cœur
  • 37,241
  • 25
  • 195
  • 267
SerenityNow
  • 1,055
  • 1
  • 15
  • 32

0 Answers0