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

NullReferenceException when removing filters

16 Answers 107 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 23 Mar 2011, 05:35 PM
Hello,

Since the upgrade to Q1 2011, I'm getting an NullReferenceException when removing a filter from DataFilter control, It's critcal for me as I cannot upload a new version to my users, it's urgent. IntelliTrace shows the following call stack trace, hope it helps:

> System.Windows.dll!System.Windows.CLRPropertyListener.Value.set(object value) + 0x23 bytes 
  System.Windows.dll!System.Windows.PropertyAccessPathStep.Value.set(object value) + 0x10 bytes 
  System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValue() + 0x3b2 bytes 
  System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValueIfNecessary() + 0x27 bytes 
  System.Windows.dll!System.Windows.Data.BindingExpression.TargetPropertyChanged(System.Windows.DependencyObject sender, System.Windows.DependencyProperty dp) + 0x2b bytes 
  System.Windows.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x17 bytes 
  System.Windows.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x51 bytes 
  System.Windows.dll!System.Windows.DependencyObject.RaisePropertyChangeNotifications(System.Windows.DependencyProperty dp, object oldValue, object newValue) + 0x5c bytes 
  System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation operation) + 0xf6 bytes 
  System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value, bool allowReadOnlySet) + 0x1da bytes 
  System.Windows.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) + 0xb bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.Selector.UpdatePublicSelectionProperties() + 0x19c bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.Selector.SelectionChanger<object>.End() + 0x30 bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.Selector.SelectionChanger<object>.ClearItems() + 0x47 bytes 
  mscorlib.dll!System.Collections.ObjectModel.Collection<object>.Clear() + 0x40 bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.Selector.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x509 bytes 
  Telerik.Windows.Controls.Input!Telerik.Windows.Controls.RadComboBox.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x25 bytes 
  System.Windows.dll!System.Windows.Controls.ItemsControl.OnItemCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x52 bytes 
  System.Windows.dll!System.Windows.Controls.ItemCollection.NotifyCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x37 bytes 
  System.Windows.dll!System.Windows.Controls.ItemCollection.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x20 bytes 
  System.Windows.dll!System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x3d bytes 
  System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<Telerik.Windows.Data.FilterOperator>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x3a bytes 
  System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<Telerik.Windows.Data.FilterOperator>.ClearItems() + 0x93 bytes 
  mscorlib.dll!System.Collections.ObjectModel.Collection<Telerik.Windows.Data.FilterOperator>.Clear() + 0x27 bytes 
  Telerik.Windows.Controls.Data!Telerik.Windows.Controls.Data.DataFilter.SimpleFilterViewModel.Dispose(bool disposing) + 0xaf bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.ViewModelBase.Dispose() + 0x26 bytes 
  Telerik.Windows.Controls.Data!Telerik.Windows.Controls.Data.DataFilter.FilterViewModel.Dispose(bool disposing) + 0x5c bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.ViewModelBase.Dispose() + 0x26 bytes 
  Telerik.Windows.Controls.Data!Telerik.Windows.Controls.Data.DataFilter.CompositeFilterViewModel.FilterViewModelCollection.Detach(Telerik.Windows.Controls.Data.DataFilter.FilterViewModel viewModel) + 0x7a bytes 
  Telerik.Windows.Controls.Data!Telerik.Windows.Controls.Data.DataFilter.CompositeFilterViewModel.FilterViewModelCollection.RemoveItem(int index) + 0x3b bytes 
  mscorlib.dll!System.Collections.ObjectModel.Collection<Telerik.Windows.Controls.Data.DataFilter.FilterViewModel>.Remove(Telerik.Windows.Controls.Data.DataFilter.FilterViewModel item) + 0x75 bytes 
  Telerik.Windows.Controls.Data!Telerik.Windows.Controls.Data.DataFilter.FilterViewModel.OnRemoveCommand() + 0xaa bytes 
  Telerik.Windows.Controls.Data!Telerik.Windows.Controls.Data.DataFilter.FilterViewModel.RemoveFilterCommand.Execute(object parameter) + 0x2a bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.RadButton.ExecuteCommand() + 0x7c bytes 
  Telerik.Windows.Controls!Telerik.Windows.Controls.RadButton.OnClick() + 0x3f bytes 
  System.Windows.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) + 0x8e bytes 
  System.Windows.dll!System.Windows.Controls.Control.OnMouseLeftButtonUp(System.Windows.Controls.Control ctrl, System.EventArgs e) + 0x31 bytes 
  System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj, System.IntPtr unmanagedObjArgs, int argsTypeIndex, int actualArgsTypeIndex, string eventName) + 0x234 bytes 
  [Appdomain Transition] 

16 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 23 Mar 2011, 06:07 PM
Hello Daní,

We have just fixed a bug that resembles your description very much. The fix will be available with the next Latest Internal Build.

Meanwhile, what do we need to do to reproduce your exception? We want to test locally against the fixed binaries. Thanks in advance.

Best wishes,
Ross
the Telerik team
0
Daní
Top achievements
Rank 1
answered on 23 Mar 2011, 06:10 PM
Hello Ross,

Reproducing the error is really easy, just adding a filter and then removing it causes the exception. I'm placing the RadDataFilter as the DropDownContent of a RadRibbonDropDownContent placed in a RadRibbonGroup. Don't doubt to contact me if you need more info a demo solution.
0
Lee Weisenberger
Top achievements
Rank 1
answered on 23 Mar 2011, 09:19 PM
You can see the same, or similar, exception by looking at the Telerik Demos for the RadDataFilter.

Using the DomainDataSource DataFilter example, add one or more filters, then try to clear all of the filters by clicking on the red 'X' next to the 'And' root.  This is throwing an exception even in the demo.
0
Rossen Hristov
Telerik team
answered on 24 Mar 2011, 06:15 PM
Hi Lee Weisenberger,

Could you please test this when the Latest Internal Build rolls out on Monday. Let me know if there are problems after you upgrade to it. Thanks.

Greetings,
Ross
the Telerik team
0
Daní
Top achievements
Rank 1
answered on 28 Mar 2011, 10:18 AM
Hi Ross,

It seems is not working yet, maybe you're not updated the demo yet. In addition at this bug, when the changing the filtering property, the FilterOperator often appears empty.
0
Rossen Hristov
Telerik team
answered on 28 Mar 2011, 11:51 AM
Hi Daní,

We have not released a Latest Internal Build yet.

Don't look at the demo, since it will not be updated until the service pack.

What you need to do is test with the Latest Internal Build once it is released later today.

I hope this makes sense.

All the best,
Ross
the Telerik team
0
Daní
Top achievements
Rank 1
answered on 28 Mar 2011, 11:54 AM
Hi Ross

When do you plan release the service pack? I don't like using LIB versions, I have many problems with telerik's dll verisions and TFS when using LIB assemblies.
0
Rossen Hristov
Telerik team
answered on 28 Mar 2011, 11:56 AM
Hi Daní,

In mid-April.

Kind regards,
Ross
the Telerik team
0
Morten Vange
Top achievements
Rank 1
answered on 29 Mar 2011, 07:56 PM
We have the same problem at finds the Datafilter in Q1 2011 not useful at all due to many bugs related to this topic. Please send service pack asap. Thanks beforehand
0
David
Top achievements
Rank 1
answered on 12 Apr 2011, 02:07 AM
Hi, when do you expect the SP? I'm planning on using DataFilter in one of my projects but I can't until this issue is fixed. Thanks!
0
Vlad
Telerik team
answered on 12 Apr 2011, 07:08 AM
Hi,

 The official Q1 2011 SP1 will be released before the end of this week. 

Greetings,
Vlad
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
Daní
Top achievements
Rank 1
answered on 15 Apr 2011, 11:06 AM
Hi,

When SP1 will be available?
0
Hristo
Telerik team
answered on 15 Apr 2011, 12:00 PM
Hello Daní,

Q1 2011 SP1 will be shipped early next week.

All the best,
Hristo
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
Daní
Top achievements
Rank 1
answered on 20 Apr 2011, 12:23 PM
Hello,

Finally, Q1 SP1 is here. This issue is fixed and, till now, I haven't experienced any error removing filters. But, I think, still one fix is missing. Whenever users changes the property wich he wants filter by, the operator combo gets empty. 
0
Daní
Top achievements
Rank 1
answered on 21 Apr 2011, 11:18 AM
Hello,

I found a workaround to, by the moment, solve the empty operator combobox issue when changing Member in a Filter Descriptor. First, you have to subscribe to RadDataFilter.FilterDescriptors.ItemChanged event. This evebt is raised each time a filter property (Member, Value or Operator) is modified. The event handler methods is as follows:
private void FilterItemChanged(object sender, ItemChangedEventArgs<IFilterDescriptor> e)
        {
            if (e.PropertyName == "Member")
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    if ((e.Item as FilterDescriptor).Operator == FilterOperator.IsEqualTo)
                        (e.Item as FilterDescriptor).Operator = FilterOperator.IsNotEqualTo;
                    (e.Item as FilterDescriptor).Operator = FilterOperator.IsEqualTo;
                }
                );
            }
        }
0
Rossen Hristov
Telerik team
answered on 26 Apr 2011, 08:16 AM
Hello Daní,

Thanks for the workaround.

We will investigate this weird behaviour. What I have noticed is that it only happens sometimes, which is very strange.

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
Tags
DataFilter
Asked by
Daní
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Daní
Top achievements
Rank 1
Lee Weisenberger
Top achievements
Rank 1
Morten Vange
Top achievements
Rank 1
David
Top achievements
Rank 1
Vlad
Telerik team
Hristo
Telerik team
Share this question
or