This is a migrated thread and some comments may be shown as answers.

How to perform Add/Edit/Delete in VirtualQueryableCollectionView.

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Parthiv
Top achievements
Rank 1
Parthiv asked on 29 Apr 2016, 04:53 AM
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,

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 29 Apr 2016, 10:27 AM
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.
Tags
GridView
Asked by
Parthiv
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or