I need to be notified about every change in filter settings. When filters are changed, events RecordFilterChanged and RecordFilterChanging are correctly raised. But when filters are cleared by clicking on Clear Filter button (be it button for filter cell or for whole filter row), filters are cleared, data updated, but events are not raised.
I have tried to bind to this.XamDataGrid1.FieldLayouts[0].RecordFilters.CollectionChanged event, but it is triggered only when adding new filters, not when filters are cleared.
Thanks
Milan
Hello Marco,
Thank you for your post. I have been looking into and I created a sample project for you with the functionality you want. Basically I handled the DataRecordPresenter’s and FilterCellValuePresenter’s Loaded events and add handler for the Clear Buttons. In that handler a checked whether the sender is the ClearAll Button and if not I got the sender’s FilterCellValuePresenter, so I can know which Field’s Filters are cleared.
Feel free to write me if you have further questions.
Hi, I'm also testing your components, and maybe in the next week we'll be buying it, but in the same case of the original post, I need to verify if when clearing the filter we can catch some event, your DataGrid is one of the most important controls we care about, and it accomplish many of our requirements.
Can you help us, to download the Service Release, until we finish our testing period?.
Thanks.
Marco Rojas.
I have had this confirmed as a bug by Infragistics and I am currently waiting for a Service Release to resolve the issue.
As a work around I created an attached behavior, I needed to have a bindable Filtered Collection, which I could operate on in the VM
public class GridFilteredCollection
{
#region Constants and Fields
/// <summary>
/// XamFilteredSet Attached Dependency Property
/// </summary>
public static readonly DependencyProperty FilteredCollectionViewProperty =
DependencyProperty.RegisterAttached(
"FilteredCollectionView",
typeof(XamFilteredCollectionContainer),
typeof(GridFilteredCollection),
new FrameworkPropertyMetadata(
new XamFilteredCollectionContainer(),
new PropertyChangedCallback(OnCollectionViewChanged)));
#endregion
#region Public Methods
/// Gets the XamFilteredSet property. This dependency property
/// indicates ....
public static XamFilteredCollectionContainer GetFilteredCollectionView(DependencyObject d)
return (XamFilteredCollectionContainer)d.GetValue(FilteredCollectionViewProperty);
}
/// Sets the XamFilteredSet property. This dependency property
public static void SetFilteredCollectionView(DependencyObject d, XamFilteredCollectionContainer value)
d.SetValue(FilteredCollectionViewProperty, value);
#region Methods
/// Handles changes to the XamFilteredSet property.
private static void OnCollectionViewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
var grid = d as XamDataGrid;
if (grid == null)
return;
var container = e.NewValue as XamFilteredCollectionContainer;
if (container == null)
container.Set = grid.RecordManager.FilteredInDataItems;
public class XamFilteredCollectionContainer
#region Properties
public ICollectionView Set { get; set; }
and in Xaml I bind to the Filtered set like this: GridFilteredCollection.FilteredCollectionView="{Binding FilteredSetContainer}"
It seems that the Record Filter Changed is Fired before the FilteredInDataItems is updated, which I think is a bug.