Hi Telerik,
It seems to me the RadDataGrid is not updating it self when applying a filter to its datasource of type ObservableCollection<T>:
I've tried the same code - just using the standard ListBox - and that works as expected.
The filter is applied and the listbox is updated to only show the items that apply to the filter - but that doesn't work for the RadDataGrid:
Here's a little code example:
Thats a bug right?
I've also noticed that you have an Telerik.Windows.Controls.Core.RadObservableCollection<T> available.
Whats that for?
It seems to me the RadDataGrid is not updating it self when applying a filter to its datasource of type ObservableCollection<T>:
I've tried the same code - just using the standard ListBox - and that works as expected.
The filter is applied and the listbox is updated to only show the items that apply to the filter - but that doesn't work for the RadDataGrid:
Here's a little code example:
| //_availableOnBoardSalesProducts is of the type ObservableCollection<Products> |
| gridFood.ItemsSource = _availableOnBoardSalesProducts; |
| myListBox.ItemsSource = _availableOnBoardSalesProducts; |
| //Add an item to the ObservableCollection works fine in the RadDataGrid |
| private void Button_Click(object sender, RoutedEventArgs e) |
| { |
| _availableOnBoardSalesProducts.Add(new OnboardSalesService.Products() { Price = 10m, Description = "MyDesc", Category = "MyCat" }); |
| } |
| //But applying a filter only works fine for the standard ListBox - not for the RadDataGrid |
| private void Button_Click_1(object sender, RoutedEventArgs e) |
| { |
| ICollectionView view = CollectionViewSource.GetDefaultView(gridFood.ItemsSource); |
| if (view.Filter == null) |
| { |
| view.Filter = delegate(object item) |
| { |
| bool result = ((OnboardSalesService.Products)item).Price == 10m; |
| return result; |
| }; |
| } |
| else |
| { |
| view.Filter = null; |
| } |
| } |
Thats a bug right?
I've also noticed that you have an Telerik.Windows.Controls.Core.RadObservableCollection<T> available.
Whats that for?