Selected data not being sent back to controller

4 posts, 1 answers
  1. DominionZA
    DominionZA avatar
    49 posts
    Member since:
    Jul 2007

    Posted 05 Aug 2013 Link to this post

    My previous post went unanswered and had to figure it out myself (so much for premium support), but eventually got it figured out. Now I am stuck again - with the same stupid widget.
    $999 for half working widgets, basic documentation and no support is starting to seriously get to me.

    Anyway, I am populating my Multiselect widget with a list of Weighbridges. This part works fine. I can also select weighbridges with no problem.
    When I post back to the controller, the model reflects the number of items I selected in the Multiselect, but the data is either null (for strings) or 0 (for ints).

    Controller populating the ViewBag
    ViewBag.Weighbridges = dbDataService.ToLookUp<Weighbridge>();
    My Lookup class
    public class LookupEntity : ILookupEntity
    {
        public int Id { get; set; }
        public string Description { get; set; }
    }
    Widget implementation
    @(Html.Kendo().MultiSelectFor(model => model.Weighbridges)
                          .Name("Weighbridges")
                          .DataTextField("Description")
                          .DataValueField("Id")
                          .Value(Model.Weighbridges)
                          .Placeholder("Select weighbridges...")                
                          .HtmlAttributes(new {style= "width:310px"})                     
                          .AutoBind(true)
                          .BindTo((IEnumerable<LookupEntity>)ViewBag.Weighbridges)
                    )
    My UserModel class with the portion of interest.
    [DisplayName("Assigned Weighbridges")]
    public IEnumerable<LookupEntity> Weighbridges { get; set; }


    Upon posting back to the controller, the rest of the model details are 100%. My Weighbridges property shows the number of items that were selected in the Multiselect, but none of the values are set.

    I am using the Multiselect in a popup editor for grid editing.

    Can someone help? And today please. I have wasted 2 full working days trying to get the Multiselect to work. KendoUI is supposed to boost productivity surely?









  2. DominionZA
    DominionZA avatar
    49 posts
    Member since:
    Jul 2007

    Posted 06 Aug 2013 Link to this post

    I need to figure out how support works with Kendo. Is it quicker to get a response via email? Are the support forums checked once a week or something?

    I have yet to get a quick response via the forums. Going to try direct email now.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 06 Aug 2013 Link to this post

    Hello,

    The quickest way to get a response is to submit a support ticket from your account. We guarantee a 24 hours response time for tickets. 
    Regarding the issue - you should use the request Data function to serialize the collection in a way that can be processed by the ModelBinder. Please check this code-library project for a sample.

    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. DominionZA
    DominionZA avatar
    49 posts
    Member since:
    Jul 2007

    Posted 08 Aug 2013 Link to this post

    Thanks. It is working now - and nicely too.

    Appreciate the feedback.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready