Listbox with template and MVVM - not data displayed when item moved

2 posts, 0 answers
  1. Francis
    Francis avatar
    8 posts
    Member since:
    Oct 2012

    Posted 04 Aug 2017 Link to this post

    I implemented two listboxes with drag-drop enabled. The listboxes use a template to displayed their items.

    When I drag or move an item with the toolbar to the second listbox, the item is moved but the data is not displayed. My template must be OK because when I load the view the first time, the items are correctly displayed in the listboxes. Also, if I send the binding information, I received the correct information with the dragged items in the second listboxes so it is only a displaying issue that I cant figure out.

    You can see the problem in the html in attachment. Try to drag an item to one listbox to another.

  2. Stefan
    Stefan avatar
    3039 posts

    Posted 08 Aug 2017 Link to this post

    Hello Francis,

    Thank you for the provided example.

    After additional investigation and consulting with the developer's team, I can confirm that this is expected because the template is not automatically rebound after drag and drop. In this scenario I can suggest manually refreshing the second ListBoxt on the dragend event of the first ListBox:

    Also, both ListBox widgets have to be bound to a dataSource instance.

    I modify the example to demonstrate this:

    Similar logic may need to be added to the add event(with timeout) if the arrows from the toolbar will be used:

    I hope this is helpful.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top