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

GridView and DataPager select all problem

3 Answers 95 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Globanet
Top achievements
Rank 1
Globanet asked on 21 Dec 2012, 01:35 PM
Hello,

I have RadGridView working with DataPager. I encountered a problem when tried to select all items in RadGridView. To do this I am going through each page of DataPager and add items to GridView SelectedItems collection. It seems to work, but after that if I try to switch page or deselect any item - my selection is removed. 

What is right approach to do what I want?  

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 21 Dec 2012, 01:51 PM
Hi,

RadGridView may keep track only of selected items present in its ItemsSource . In paged scenario it knows about the items in the current page only . That is why any attempt  t add items from other pages to its selected items collection would appear unreliable.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Globanet
Top achievements
Rank 1
answered on 21 Dec 2012, 02:52 PM
Yes, I know how it works. My question is how can I get desired result, is there any other way to select all items?
0
Maya
Telerik team
answered on 24 Dec 2012, 07:48 AM
Hello Globanet,

As mentioned previously, RadGridView is not aware of the items that will be displayed on the next page. What you can try is to handle the events fired on changing the pages and implement the logic you require there.  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Globanet
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Globanet
Top achievements
Rank 1
Maya
Telerik team
Share this question
or