Filtering in RadGrid

5 posts, 0 answers
  1. Ramesh
    Ramesh avatar
    5 posts
    Member since:
    Jan 2011

    Posted 21 Jan 2011 Link to this post

     I am using Telerik Rad grid in My application. My requirement is like this.

    I have Products View with their status whether Active or Inactive. So in this grid i have two Columns named "Products" and "Status".
    Whenever the grid is loaded or in the first view of grid, User should able to see only all the Active Products. If user wants to see all products(both active & inactive) after loading the grid, he should able to see it by clicking on filter icon on that column.
    Please tell how to do this or plz give any sample code.

  2. Matti
    Matti avatar
    2 posts
    Member since:
    Jan 2011

    Posted 23 Jan 2011 Link to this post

    When you are loading your grid, you can do the following.
    If your status field is using the text to show status then use that as filter.
    in code behind:
    FilterDescriptor theFilter=new FilterDescriptor("Status",FilterOperator.IsEqualTo,"active",true);
    or xaml:
    <telerik:RadGridView x:Name="radGridView1">
         <telerik:FilterDescriptor Member="Status" Operator="IsEqualTo" Value="active" IsCaseSensitive="True">

    Or, if you are using a boolean state, like checkbox change it to this.
    FilterDescriptor theFilter=new FilterDescriptor("Status",FilterOperator.IsEqualTo,true,true); 
    You can also use 1 instead of true as boolean state.
    and xaml:
    <telerik:RadGridView x:Name="radGridView1"
         <telerik:FilterDescriptor Member="Status" Operator="IsEqualTo" Value="True" IsCaseSensitive="True"

    Hope this helps,

  3. Marco
    Marco avatar
    11 posts
    Member since:
    Dec 2011

    Posted 19 Mar 2013 Link to this post

    Hello I use the same code:
             <telerik:FilterDescriptor Member="RowStatus" Operator="IsNotEqualTo" Value="NotVisible"/>

    The RowStatus is bound to a Member in my Datasource, when I change It in my MVVM I send the  OnPropertyChanged("RowStatus").
    But unfortunately the Grid make nothing. Why the grid is not filtering, when the bound value is changing?
    Is the a possibility to restart the filter programmatically in th MVVM.

    Thank you for your help
  4. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 20 Mar 2013 Link to this post


    In order to have the FilterDescriptors re-evaluated, you have to notify the GridView that the bound collection has been changed (CollectionChanged event to be raised). I would suggest you to edit the items as suggested in this help article. Does this solve the problem?

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Marco
    Marco avatar
    11 posts
    Member since:
    Dec 2011

    Posted 22 Mar 2013 Link to this post

    the tip with the EditItem and Commit hasn't worked
    Now I'm using:

    FilterDescriptor theFilter = new FilterDescriptor("RowIsVisible", FilterOperator.IsEqualTo, "True", false);

    This works, thank you
    Greetings Marco
Back to Top