How to perform Add/Edit/Delete in VirtualQueryableCollectionView.

2 posts, 0 answers
  1. Digip
    Digip avatar
    1 posts
    Member since:
    Sep 2012

    Posted 28 Apr Link to this post

    In our project, we have a requirement to show, millions of data from databas and hence we have used
    Data virtualization feature in RadGridView using VirtualQueryableCollectionView. Now loading is working
    as expected, but we have add/edit/delete functionality within grid. But that seems not working.

    Could you please provide some sample or document which can guide us to achieve this.

    Looking forward to hear you soon.

    Thanks,
  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 29 Apr Link to this post

    Hi,

    As mentioned in our documentation article regarding the Data Virtualization, the virtual collection is designed for ReadOnly purposes and it is not recommended to use it in scenarios where updates are required. You can add/delete items but you will have to work with the VirtualItemCount property of the VQCV(increase it in case you are adding an item) and rebind the RadGridView as well, which might not be ideal.

    var collection = this.clubsGrid.ItemsSource as VirtualQueryableCollectionView;
              collection.Add(new Club("Everton", DateTime.Now, 45000));
              collection.VirtualItemCount++;
              clubsGrid.Rebind();

    Another approach would be to add/remove items from your source directly and reload the VQCV.

    Regards,
    Stefan Nenchev
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top