Hi Eric,
there is not such an event in the DataGridCollectionView. I will fill a feature request for this.
A workaround would be to register to every DataGridCollectionView.AutoFilterValues CollectionChanged as follow:
IDictionary<string, IList> gridFilters = dataGridCollectionView.AutoFilterValues;
foreach( IList autofilterValues in gridFilters.Values )
{
INotifyCollectionChanged notifyCollectionChanged = autofilterValues as INotifyCollectionChanged;
notifyCollectionChanged.CollectionChanged += new NotifyCollectionChangedEventHandler( AutoFilterValues_CollectionChanged );
}
Don't forget to unregister before changing the DataGridControl's ItemsSource or use the CollectionChangedEventManager to register to CollectionChanged in a WeakListener way in order to avoid memory leaks.
This way, in the AutoFilterValues_CollectionChanged event handler, you will be able to retreive the "auto-filtered" field as follow:
foreach( string fieldName in dataGridCollectionView.AutoFilterValues.Keys )
{
if( dataGridCollectionView.AutoFilterValues[ fieldName ] == targetAutoFilterValues )
return fieldName;
}
return null;
Christian Nadeau
Software Developer
Xceed Software Inc.