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

Getting Selected Items from select column [RadGridView & RadPager]

1 Answer 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shreya
Top achievements
Rank 1
Shreya asked on 25 Nov 2014, 01:46 PM
Hi,
Can you please help me in this...

I am facing a problem, using RadGrid and since it has many records I have used RadPager. I have a GridViewSelectColumn in my grid to select and deselct all. The paging works perfectly. I am using MVVM patterm in my solution.
Please Help me in achieving following scenarios:

1) When Select All suppose I have 186 records and my page size is 10 so I have 19 pages in raddatapager and last one has only 6 records. how can I select all the 186 records  

2) To capture my selecteditems I have attached a behaviour to grid to get the selected Items in my view model. There I am only getting the first page selected Items
((CAManagementViewModel)this.AssociatedObject.DataContext).SelectedVehicles = this.AssociatedObject.SelectedItems;

3) In the above property of selected Items if user selects different records on different page how to get all maintained in SelectedItems of
grid.

Thanks a lot in advance. Please some help, Its urgent.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 26 Nov 2014, 02:01 PM
Hello,

When the grid is being paged, it is actually aware of the current page only. The RadGridView simply "knows" that someone is changing its ItemsSource, which is the new page. It does not know how many pages are there and it also does not know about all the other items not displayed on the current page.  

You could remember the selection and set the SelectedItems once a page is navigated
to, however, RadGridView.SelectionItems collection can only hold the selected items on the current page.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Shreya
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or