Cascading dropdownlistfor fires validation on new form

8 posts, 0 answers
  1. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 07 Sep Link to this post

    I have a grid with a pop-up edit form, with a cascading dropdown list. It works fine except that when choosing to add a new record, the form opens and the dropdown list shows the validation error message before the user has done anything.

     

    I've attached a screenshot. The definition of the dropdown lists is:-

      <p>
            <span class="fieldlabel">
                System:
            </span>
            @(Html.Kendo().DropDownListFor(m => m.system)
    .Name("system")
    .OptionLabel("Select a system")
    .DataValueField("Code")
    .DataTextField("Description")
    .DataSource(src => src.Read(rd => rd.Action("GetSystems", "Home")))
     
            )
     
            @Html.ValidationMessageFor(model => model.system)
     
    </p>
     
        <p>
            <span class="fieldlabel">
                Priority:
            </span>
            @(Html.Kendo().DropDownListFor(m => m.Priority)
    .Name("Priority")
    .OptionLabel("Select a priority")
    .DataValueField("Code")
    .DataTextField("Description")
    .DataSource(src => src.Read(rd => rd.Action("GetPriorities", "Home")))
     
            )
     
            @Html.ValidationMessageFor(model => model.Priority)
     
        </p>
     
     
        <p>
            <span class="fieldlabel">
                Sub Category:
            </span>
            @(Html.Kendo().DropDownListFor(m => m.SubCategoryCode)
    .Name("SubCategoryCode")
    .OptionLabel("Select a sub category")
    .DataValueField("Code")
    .DataTextField("Description")
    .DataSource(src => src.Read(rd => rd.Action("GetSubCategoriesbySystem", "Home").Data("filterSystems")).ServerFiltering(true))
     .Enable(false)
    .AutoBind(false)
    .CascadeFrom("system")
     
            )
     
            @Html.ValidationMessageFor(model => model.SubCategoryCode)
     
        </p>

    How can I stop this?

     

    Thanks

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 09 Sep Link to this post

    Hello Andrew,

    We have a code library that covers the cascading DropDownLists in the Grid's popup editor scenario. I tested it with version 2016.2.714 and a validation message was not displayed on popup opening, but after clicking on a DropDownList. Could you please run it, try to reproduce the behavior you are experiencing it it and attach it for further review?

    Looking forward to your reply.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 09 Sep in reply to Ivan Danchev Link to this post

    Thanks for this. I got the library code to run, and it was fine. I then transferred the classes and page over to my project, and got some very strange behaviour.

    1. A record could be saved without any validation firing, if all the dropdowns were left untouched.

    2. As soon as the first drop-down was clicked, all validation messages fired (screenshot attached).

    I'm using Version 2016.2.504 of KendoUI, Version 4.5 of the .NET framework and MVC 5.

  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 12 Sep Link to this post

    Hello Andrew,

    We were able to reproduce the behavior you describe. It seems a change has been introduced to the validation logic since Q1 2016, because the validation triggers differently if version 2015.3.930 scripts are used compared to using 2016.1.112 and newer. We will need more time, in order to further investigate this inconsistency. I will get back to you as soon as we have any result.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 13 Sep in reply to Ivan Danchev Link to this post

    Thanks, I look forward to hearing from you.
  7. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 15 Sep in reply to AP Link to this post

    Does the latest 2016.3.914 still have this bug?
  8. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 15 Sep Link to this post

    Hello Andrew,

    Thank you for your patience.

    The behavior in the latest version is identical to the one in Q1 2016 and newer releases. We logged a public issue that contains more information.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 15 Sep Link to this post

    Hi Andrew,

    As a token of gratitude for your involvement in identifying this issue I updated your Telerik points.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready