6 Answers, 1 is accepted
The reported behavior would be the expected one. The Filtering event is raised only when the user filters the control through the UI. For your requirement, you can utilize the CollectionChanged event of the FilterDescriptors collection of RadGridView.
Can you please give the suggestion a try and let me know how it goes?
Best Regards,
Stefan X1
Telerik by Progress
Thank you for your answer.
The solution actually launches the event 2 times with different e.Action = ... so you can easily capture one of them. Unfortunately, it has a drawback: the event is fired before updating ItemSource (QueryableCollectionView) - I need to update items that are currently in the visible list.
Filtered / Sorted events are fired after the ItemSource (QueryableCollectionView) update.
Do you have any suggestions?
Regards.
Thanks for the clarification.
Since you are using a QCV as a source collection, you should be able to utilize its CollectionChanged event for this requirement.
Would such an approach be feasible for you?
Regards,
Stefan X1
Telerik by Progress
I found the reason of problem. Method in CollectionChanged was calling MyRadGridView?.Rebind() (for the present values) and this one sometimes was cause exception of modyfication ObservableCollection object.
I resolved the problem in this way:
private void MyRadGridViewFilterDescriptors_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
{
this.Dispatcher.BeginInvoke(new Action(RefresrList), System.Windows.Threading.DispatcherPriority.Background);
}
}
private async void RefresrList()
{
await MyRadGridView_VM.RefreshList();
}
I found that TowarRadGridView?.Rebind(); cause the esception of modyfication ObservableCollection object.
I solved this by calling this.Dispatcher.BeginInvoke(new Action(RefreshTowarList), System.Windows.Threading.DispatcherPriority.Background); in CollectionChanged event andt this works fine now :)
I am happy that you've managed to find a solution that suits your needs.
In case any other assistance with our components is needed, feel free to contact us again.
All the best,
Stefan X1
Telerik by Progress