WPF RadGridView Filter

7 posts, 0 answers
  1. imad
    imad avatar
    19 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2010 Link to this post

    Hi,

    I have 2 questions regarding the filtering behavior in WPF RadGridView, The first is how to get a DataTable from the filtered data without looping over the records property (maybe generate a Linq Expression from the FilterDescriptors).

    The Second is how to clear all filters by code, i tried FilterDescriptors.Clear() this will cancel the filter for the data records but the filter interface still have checkboxes on the previous selected values.


    Thanks.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 01 Apr 2010 Link to this post

    Hi imad,

    1. If you have filtered RadGridView, you can access the filtered data through its Items property -- this will give you only the items that are currently visible.

    2. RadGridView.FilterDescriptors.Clear()  is the correct way to do it. It will not leave any UI indications as demonstrated in the sample project that I have attached.

    P.S. The "Select All" check-box might be left in indeterminate state (i.e. a dash), but we have logged this bug and will fix it as soon as possible.

    Sincerely yours,
    Ross
    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. UI for WPF is Visual Studio 2017 Ready
  4. ClausDC
    ClausDC avatar
    58 posts
    Member since:
    Feb 2010

    Posted 22 Apr 2010 Link to this post

    Question to 1.: Is there any way to bind to the "Items" Property? If not, is there any way to bind to some property of the GridView which gives me the filtered data? I'm using MVVM and it would be very helpful to access this information via data binding.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 22 Apr 2010 Link to this post

    Hello,

    Indeed Items will respect filtering however you can bind this property only one way since there is no public setter.

    Sincerely yours,
    Vlad
    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.
  6. ClausDC
    ClausDC avatar
    58 posts
    Member since:
    Feb 2010

    Posted 22 Apr 2010 Link to this post

    Yeah, but how? "Items" doesn't seem to be accessible for binding.

    If I use

    <tk:RadGridView.Items>
                    <Binding Path="VisibleItems" Mode="OneWay"></Binding>
                </tk:RadGridView.Items>


    for example I get an error stating:

    "The property 'RadGridView.Items' cannot be set because it does not have an accessible set accessor."

  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 22 Apr 2010 Link to this post

    Hi ,

    The idea is that you can bind something to Items instead Items to something.

    Best wishes,
    Vlad
    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.
  8. ClausDC
    ClausDC avatar
    58 posts
    Member since:
    Feb 2010

    Posted 22 Apr 2010 Link to this post

    Ok but if I understand you correctly that would mean that I would have to do sorting and filtering myself because changes to the Items collection would come from my ViewModel. But I need the exact opposite - When filtering and/or sorting is done on the GridView-control I need the results in the ViewModel, is there any way to do this via binding?




Back to Top
UI for WPF is Visual Studio 2017 Ready