[Bug] MultiSelect EditorTemplate only fires grid "save" event once

8 posts, 1 answers
  1. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 17 Mar 2015 Link to this post

    Kendo MVC 2014.3.1516

    Bug:
    If you use a MultiSelectFor in an EditorTemplate, the grid's "save" event will only fire once for that cell.  The second time you update the same cell (by picking an additional item or removing an item from the MultiSelect list), the grid's save event is not called.
  2. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 17 Mar 2015 in reply to Curt Rabon Link to this post

    columns.Bound(c => c.HTMLAttributes)
      .Title("HTML Attr").Sortable(false).Filterable(false)
      .EditorTemplateName("HtmlAttributes");

    EditorTemplate (AppCache.HtmlAttributes is a server array of a custom object)
    @model object
     
    @(Html.Kendo().MultiSelectFor(m => m)
        .Name("HtmlAttrList")
        .Animation(false)
        .DataValueField("ID")
        .DataTextField("Text")
        .BindTo(AppCache.HtmlAttributes)
     )
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 18 Mar 2015 Link to this post

    @(Html.Kendo().Grid<Field>()
                        .Name("fieldGrid")
                        .Columns(columns => ....)
                         
                        .Scrollable(scrollable => scrollable.Virtual(true))
                        .Sortable()
                        .Filterable()
                        .Editable(e => e.Mode(GridEditMode.InCell))       
                        .AutoBind(false)
                         
                        .Events(e => e
                            .Edit("myEdit")
                            .Save("mySave")
                        )
                        
                        .DataSource(ds => ds
                            .Ajax()
                            .ServerOperation(false)
                            .Model(model =>
                            {
                                model.Id(c => c.Name);
                                model.Field(c => c.Name).Editable(false);
                            })
                        )
                    )
  5. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 20 Mar 2015 Link to this post

    Hello Curt,

    The Grid widget does not support and it is not intended to edit nested arrays out-of-the-box. You can use the work-around from this code library project to enable such support:

    http://www.telerik.com/support/code-library/using-multiselect-in-grid

    Kind Regards,
    Petur Subev
    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.

     
  6. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 20 Mar 2015 Link to this post

    I don't understand what using a MultiSelect as a column editor has to do with "nested arrays".  Does the grid support using the Kendo MultiSelect as a column editor?  If so, then shouldn't the grid "save" event always be called when updating the column value by using the MultiSelect?
  7. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 20 Mar 2015 in reply to Curt Rabon Link to this post

    OK, I now understand what you are saying.  The MultiSelect produces an array and that's not supported as a column editor when editing inline or inCell.

    Is there a document that tells me what Kendo widgets are or are not supported in the grid?  Please don't leave it up to your customers to guess.
  8. Answer
    Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 23 Mar 2015 Link to this post

    Hello Curt,

    MultiSelect is the only widget which value is actually an array. DatePicker, DropDownLists , ComboBoxes, inputs, color pickers are all single values. For the specific case with the MultiSelect we have created the code library article.

    http://www.telerik.com/support/code-library/using-multiselect-in-grid

    Kind Regards,
    Petur Subev
    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.

     
  9. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 24 Mar 2015 in reply to Petur Subev Link to this post

    Thank you.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready