"Select all" command when the user is filtering

4 posts, 1 answers
  1. Joan
    Joan avatar
    9 posts
    Member since:
    Feb 2011

    Posted 07 Jun 2011 Link to this post

    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
  2. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 07 Jun 2011 Link to this post

    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
  3. Joan
    Joan avatar
    9 posts
    Member since:
    Feb 2011

    Posted 07 Jun 2011 Link to this post

    Thanks, that works.
  4. manohar
    manohar avatar
    5 posts
    Member since:
    Aug 2011

    Posted 29 Sep 2011 Link to this post

    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.
Back to Top