Cascading dropdown not sending value

3 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 16 Jan 2015 Link to this post

    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. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 16 Jan 2015 in reply to Alan Mosley Link to this post

    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>
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 20 Jan 2015 Link to this post

    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.

     
Back to Top