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

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

1 Answer 72 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.
T. Tanaka
Top achievements
Rank 1
T. Tanaka asked on 26 Jul 2012, 09:53 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 26 Jul 2012, 11:24 AM
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.

Tags
GridView
Asked by
T. Tanaka
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or