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

GridView SelectedItems bulk add

10 Answers 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 16 Dec 2010, 06:52 AM

Hello,

I have a scenario in which I need to programatically set selected rows in the RadGridView. I am using the RadGridView.SelectedItems property to achieve this. This collection is of type ObservableCollection, and when attempting to invoke SelectedItems.Add() many items in a loop, the ObservableCollection's OnCollectionChanged event fires for each Add(), which becomes unacceptably slow. I understand that is the intended behavior of the ObservableCollection. The SelectedItems property is also readonly, so I can not do a reassignment to work around it.

Can you recommend a solution for this? If the SelectedItems could be of a type that inherits from the ObservableCollection and that implements an AddRange() method, that would solve the problem. Any suggestion is appreciated. Thanks!

10 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 22 Dec 2010, 11:06 AM
Hi Ed,

Unfortunately, "bulk add" is not supported at the moment but we are currently working on improving the performance of our selection mechanism. 

May I ask you for some more information about your scenario so that I could try to provide you with some kind of workaround? How many items are being added to SelectedItems? Are you performing any action on OnCollectionChanged?


Best wishes,
Milan
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Ed
Top achievements
Rank 1
answered on 22 Dec 2010, 07:01 PM

Milan,

Potentially, thousands of items are added to the SelectedItems collection. I am not performing any actions on OnCollectionChanged.

thanks,

Ed

0
Milan
Telerik team
answered on 03 Jan 2011, 08:33 AM
Hi Ed,

Unfortunately there is no way to optimize the performance for this scenario at the moment. We are currently working on improving the overall selection performance which will resolve this problem. It is still unclear when those optimization will be available but we hope to introduce at least some of them with SP1 which will be release in mid January. 

All the best,
Milan
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Jerry Kurata
Top achievements
Rank 1
answered on 07 Jan 2011, 05:41 PM
I also need similar behavior. We have over 10,000 rows in the grid and the user may select/deselect 1000s of rows at a time. 1000s of calls to the selection changed handler is completely unacceptable.
0
Jerry Kurata
Top achievements
Rank 1
answered on 08 Feb 2011, 06:31 PM
Is there any update on a fix to this issue?

Our application interfaces with a lot of other products and the selection of data needs to be passed between these products and the grid.  As a result we need a fast method for updating the selected rows. And, of course, we need this ASAP.

0
Maya
Telerik team
answered on 10 Feb 2011, 12:42 PM
Hello,

As mentioned previously, we do our best to provide improvements on the functionality and performance for the selection. However, our intentions are to implement those enhancements only after they are fully tested and well-thought. Meanwhile, in case it is appropriate for you, you may give us a bit more details on the particular settings and scenarios you handle, so that we could make further tests targeting your cases.
Again, thank you for the cooperation and patience.

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Naseem
Top achievements
Rank 1
answered on 24 Apr 2012, 04:30 AM
Hi,

I have got the same issue. I need to add thousand thousands of rows into 'RadGridView.SelectedItems' . Since there isn't any bulk add  for that I had to add them one by one in a loop , which cause the UI page freezing for a while.

I was wondering if this issue has been fixed? The version I'm using right now is '2010.3.1314.1040'

Many thanks,

Kind Regards,
Naseem
0
Vlad
Telerik team
answered on 24 Apr 2012, 06:58 AM
Hello,

 Please use our latest official version (Q1 2012 SP1) for faster selection. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
WILLIAM
Top achievements
Rank 1
answered on 19 Jun 2012, 08:18 PM
Vlad,

I have version Q2 2012 and I don't see method or property for bulk add.

Can you give me the property, method name, or code example that supports setting the SelectedItems to an ObservableCollection without looping through the collection?

Thanks!
0
Nick
Telerik team
answered on 22 Jun 2012, 10:59 AM
Hello William,

You can use the Select method of the GridViewDataControl.

Hope this helps! 

Regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Ed
Top achievements
Rank 1
Answers by
Milan
Telerik team
Ed
Top achievements
Rank 1
Jerry Kurata
Top achievements
Rank 1
Maya
Telerik team
Naseem
Top achievements
Rank 1
Vlad
Telerik team
WILLIAM
Top achievements
Rank 1
Nick
Telerik team
Share this question
or