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

Filter ignoring INotifyPropertyChanged

2 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Geoff Smith
Top achievements
Rank 1
Geoff Smith asked on 22 Apr 2010, 10:53 AM
Hi,

Should the grid filters update when a row's item implements INotifyPropertyChanged and fires PropertyChanged on a property used as part of a filter?

For example, I have a grid which has a collection (which implements INotifyCollectionChanged) and each item implements INotifyPropertyChanged and fires PropertyChanged when the IsActive property is changed. On the grid I had a filter on the IsActive property. When I enable / disable the filter it works fine, but if the IsActive property changes while the filter is enabled, the row is not then visible. If I disable / re-enable the filter, the row is visible.

Perhaps I need to manually bubble up PropertyChanged events to the collection and fire CollectionChanged?

Thanks,

Geoff

2 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 22 Apr 2010, 12:13 PM
Hi Geoff Smith,

The current view displayed in the grid is not recreated when your property changes. This is by design.

But there is a way to let the grid know. Since the RadGridView.Items collection implements IEditableCollectionView view you can call its BeginEdit method, change the value of your property and then call its EndEdit method. This will invalidate and re-create the view.

Or you can do it with the collection changed as you described. A CollectionChanged with action "Reset' will trick the grid to refresh its view.

Let me know if this does not help or if it is not a viable option. We will try to think of something else.

Kind regards,
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.
0
Geoff Smith
Top achievements
Rank 1
answered on 22 Apr 2010, 12:17 PM
Ok cool thanks, good to know its expected behaviour
Tags
GridView
Asked by
Geoff Smith
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Geoff Smith
Top achievements
Rank 1
Share this question
or