Virtualized Grid losses selection

4 posts, 0 answers
  1. Anna
    Anna avatar
    64 posts
    Member since:
    Jul 2015

    Posted 24 Apr 2016 Link to this post

    Hi,

    I have a grid with scrollable: { virtual: true }, pagesize: 25 setup with local data. I select a row and scroll away so paging happens, when I scroll back, and selection is lost. I saw other threads with suggested solution to do hacks around onChange and onDataBound event: http://jsbin.com/himuboxi/2/edit?html,output

    My problem is, my grid is bound to local data, thus the DataBound event is fired when I scroll around. What other event could I depend on?

     

    Best,

    Ama

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 26 Apr 2016 Link to this post

    Hello,

    This behavior is expected as the idea behind the virtualized grid is to render only the number of items needed by the customer. So when you scroll and the records are re-rendered the selection is lost. The only workaround will be to save the ID of the selected record and use the dataBound event to select it back. Please see this sample:

    http://dojo.telerik.com/ALonI

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Anna
    Anna avatar
    64 posts
    Member since:
    Jul 2015

    Posted 26 Apr 2016 in reply to Kiril Nikolov Link to this post

    Hi Kiril,

    I'm aware of what you mentioned, but please read my question in detail => my grid is bound to local dataSource, so the dataBound event never fires. My question is: is there any other events I can listen to re-select the row? If not, is there any other hack I can try?

    Also, maybe in respect to the virtualized grid, losing selection is expected, overall as a grid, I believe it's a bug. At least it's a bug to the selection function of the grid. I hope in the future, the kendo team will smoothen this problem.

     

    Regards,

    Ama

  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 26 Apr 2016 Link to this post

    Hello,

    I am afraid that there is no such event for local data binding. I would suggest you to send a feature request in our Feedback forum, so it can be considered for future implementation.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top