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

[Solved] "Select all" command when the user is filtering

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joan
Top achievements
Rank 1
Joan asked on 07 Jun 2011, 09:42 AM
Hello all,

We're using RadGridView in our current project. We always use MVVM on our projects so we have an IsSelected property in our ViewModels binded to the IsSelected property of GridViewRow. Besides, there's a SelectAll checkbox binded to a property that ultimately iterates through the items and changes their IsSelected property. It seems to work like a charm and it usually does.
The problem comes when the user is filtering. The process selects all items and we want it to select only the filtered (shown) items. How would we do that using a MVVM approach? We need to know whether an item is shown after a filter operator (by shown I don't mean really visible, it could be outside the scrolling area).

Thanks,
-Tony

3 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 07 Jun 2011, 01:53 PM
Hi Tony,

RadGRidView can only select items that are in view - items that are passing the filters. I guess the problem with Select All is caused by the fact that you iterate the original item collection which contains all items. You could resolve the problem by iterating over the Items collection of the grid which   only contains  the visible items.


All the best,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joan
Top achievements
Rank 1
answered on 07 Jun 2011, 03:07 PM
Thanks, that works.
0
manohar
Top achievements
Rank 1
answered on 30 Sep 2011, 03:10 AM
I need to implement the same behaviour.

I am new to Telerik and silverlight. I would really appreciate if you can provide me the solution with some code.


Thanks.
Tags
GridView
Asked by
Joan
Top achievements
Rank 1
Answers by
Milan
Telerik team
Joan
Top achievements
Rank 1
manohar
Top achievements
Rank 1
Share this question
or