This is a migrated thread and some comments may be shown as answers.

Cascading dropdown not sending value

2 Answers 189 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 16 Jan 2015, 11:42 AM
I have some cascading drop downs, that work well when first loaded, but when submitting the form and form is not valid the form is reloaded. The cascading dropdowns are populated as before but this time the cascaded dropdown does not send a value.
I can see with IE F12 tools that when I select from the list a span is loaded with the text value of my selection, but the input has no value. I can see when I do he same with the top dropdown that the input is populated with a value.
Thanks

2 Answers, 1 is accepted

Sort by
0
Alan Mosley
Top achievements
Rank 1
answered on 16 Jan 2015, 11:45 AM
sorry forgot my code
<div class="form-group">
      @Html.LabelFor(Function(model) model.Public_SubCategory.CategoryId, "Category", New With {.class = "control-label col-md-2"})
      <br />
      <br />
      <div class="col-md-10">
 
          @code
              Dim CategoryId As Kendo.Mvc.UI.DropDownList = Html.Kendo().DropDownList().
                  Name("Product.CategoryId").DataTextField("Text").DataValueField("Value").Value(Model.Public_SubCategory.CategoryId).
              DataSource(Function(source) source.Read(Function(read) read.Action("getcategories", "promo", New With {.area = String.Empty}))).OptionLabel("Select Category")
 
              CategoryId.Render()
          End Code
 
          @Html.ValidationMessageFor(Function(model) model.Public_SubCategory.CategoryId)
      </div>
  </div>
 
 
 
  <div class="form-group">
      @Html.LabelFor(Function(model) model.SubCategoryId, "SubCategory", New With {.class = "control-label col-md-2"})
      <br />
      <br />
      <div class="col-md-10">
 
          @code
              Dim SubCategoryId As Kendo.Mvc.UI.DropDownList = Html.Kendo().DropDownList().
                  Name("Product.SubCategoryId").DataTextField("Text").DataValueField("Value").Value(Model.SubCategoryId).
                  DataSource(Function(source) source.Read(Function(read) read.Action("getsubcategoriesbyid", "promo", New With {.area = String.Empty}).Data("Schedule.FilterCategories")).ServerFiltering(True)).
              OptionLabel("Select Subcategory").
              Enable(True).AutoBind(True).
              CascadeFrom("Product_CategoryId")
 
              SubCategoryId.Render()
          End Code
 
 
          @Html.ValidationMessageFor(Function(model) model.SubCategoryId)
      </div>
  </div>
0
Georgi Krustev
Telerik team
answered on 20 Jan 2015, 09:29 AM
Hello Alan,

In general, DropDownList widgets cascade correctly with initial values. In this case, I suppose that something goes wrong either with the defined values or with the retrieved data. Could you send us a repro demo that demonstrates the issue? Thus we will be able to observe the problem locally and find the cause of the issue much faster.

Regards,
Georgi Krustev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DropDownList
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Alan Mosley
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or