Multiselect values Not available in KendoGrid Create/Update

4 posts, 0 answers
  1. Shreesh
    Shreesh avatar
    33 posts
    Member since:
    Aug 2011

    Posted 18 Oct 2014 Link to this post

    I am using UI for ASP.NET MVC Q2 2014.
    In the attached project, I am using editor template "EventEditor". In this, I have 2 dropdown and 1 multiselect.
    The dropdown is working correctly, however multiselect is NOT working. I do NOT get values in the kendogrid Update/Create (Insert methof of Events Controller). I just get count and the values in the list are null. I tried using int (for Id) and also string but nothing worked correctly.
    I also have used .Data("Serialize") but no help..
    Please solve my request at the earliest.

    Thanks

  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2203 posts

    Posted 22 Oct 2014 Link to this post

    Hi Shreesh,


    After inspecting the provided project it appears that there is some invalid configuration in the editor template for the Grid - all editors are strongly type (EditorFor helper is used) and at the same time the "Name" option of the widget is specified which is invalid configuration.

    <label> Employee:  </label>  
    @(Html.Kendo().DropDownListFor(i => i.Employee)
        .DataValueField("EmployeeId")
        .DataTextField("EmployeeName")
        .BindTo((System.Collections.IEnumerable)ViewBag.EmployeeList)
        .SelectedIndex(0)
        .OptionLabel("Select ...")
    )

    Also the from the provided information it seems that there is no default value set for the "SelectedCustomers" field which can prevent the MultiSelect from working correctly - could you please set the DefaultValue to empty array and let us know of the result?

    Regards,
    Vladimir Iliev
    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.

     
  3. Shreesh
    Shreesh avatar
    33 posts
    Member since:
    Aug 2011

    Posted 22 Oct 2014 in reply to Vladimir Iliev Link to this post

    I am not using strong typing for dropdown, so no issues and working as acceptable..

    However with your inputs, I tried to initialize the multiselect, however I still get only count and values are null.
    Can you please tell me in the project (erplite.zip) that I have given in my previous post where to initialize the SelectedCustomer list and how to do it...
  4. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2203 posts

    Posted 23 Oct 2014 Link to this post

    Hi Shreesh,

    From your previous reply I understand that the MultiSelect is showing values, however they are not persisted in the Grid after saving the changes - could you please clarify if this is the case?
    Also after the changes suggested in my previous reply it's not clear for us what might be the reason for current behavior - could you pleas provide runable example where the issue is reproduced (you can use static data at the server side and not include dataBase)? This would help us pinpoint the exact reason for this behavior.

    Regards,
    Vladimir Iliev
    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