How to filter data automatically by specified property is not displayed in GridView as a column

2 posts, 1 answers
  1. T. Tanaka
    T. Tanaka avatar
    6 posts
    Member since:
    Apr 2012

    Posted 26 Jul 2012 Link to this post

    Hi,

    I want to filter data in GridView by a property automatically,
    but I don't want to show the property in GridView as a column.
    So I have a problem with it.

    In my design, I have a property called "IsVisible" in Entity.
    And in GridView, there is a column filled with Button.
    To filter data, I also added a FilterDescriptor below when GridView is constructed.

    public TreeGridView()
        : base()
    {
        FilterDescriptor treeFilter = new FilterDescriptor();
        treeFilter.Member = "IsVisible";
        treeFilter.Value = true;
        treeFilter.Operator = FilterOperator.IsEqualTo;
     
        FilterDescriptors.Add(treeFilter);
    }

    There is a column filled with Buttons.
    The value of "IsVisible" is true by default.
    I desire to change the value of IsVisible into false when I clicked the button(this step is working),
    and filter the row which IsVisible is false automatically(this step don't work).

    If I show IsVisible as a Checkbox column, 
    it works automatically when I edited IsVisible cell to change IsVisible into false,and lost focus from IsVisible cell .
    I think if there is a trigger be triggered when I edited IsVisible on Checkbox cell,
    but the trigger don't work in the way of changing property directly?

    Is there any way to filter the rows when specified property changed automatically?

    Best regards,
    Liu
  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 26 Jul 2012 Link to this post

    Hi Liu,

    Basically the filter will be refreshed when a CollectionChanged event on the bound source is raised. May I ask you to share some additional details? Is the "IsVisible" a property of the bound data item? If so, then you need to use the approach suggested in our online documentation when editing its value.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top