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

Clicking on filter button causes NullReferenceException

6 Answers 103 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ClausDC
Top achievements
Rank 1
Iron
Iron
ClausDC asked on 25 Nov 2010, 09:30 AM
I get a NullReferenceException after clicking the GridView filter button in the following scenario:

1. The GridView has too many columns to fit in the current window so it has horizontal scroll bars.
2. I scroll the GridView content to the left so that column A is not visible anymore because it is now too much to the left.
3. I scroll back to the right so that column A is visible again.
4. I click the filter button of column A.
5. NullReferenceException is thrown.

I use the official Q3 2010 release of the GridView control.

Here are the exception details:

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.GridView
  StackTrace:
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownPopupOpened(Object sender, EventArgs e) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 333
       at System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)
       at System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 129
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 75
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.set_IsDropDownOpen(Boolean value) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 64
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownButtonClick(Object sender, RoutedEventArgs e) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 349
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run()
       at dcits.AdminClient.Controller.Main()
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

6 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 25 Nov 2010, 10:20 AM
Hi ClausDC,

We followed your steps but we couldn't reproduce any exception. Could you post more details about your grid and the column's declaration ? Also, is this problem reproducible is our online demos ?
 
Regards,
Yordanka
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
ClausDC
Top achievements
Rank 1
Iron
Iron
answered on 25 Nov 2010, 03:28 PM
I was able to narrow the problem further down.

I have the property "HeaderCellStyle" of my GridViewDataColumns set to a custom Style.

This custom style is a copy of the default Win7 Style (with some adjustments) for the GridViewHeaderCell which I obtained via the "Edit Temlpate -> Edit a Copy" method in ExpressionBlend.

As a test, I removed every custom adjustment I made to the style and have so only used the default/vanilla style for the HeaderCellStyle property. I still get a NullReferenceException.

If I don't set the "HeaderCellStyle" property in my GridViewDataColumns, the NullReferenceException does not occur and everything works fine.

I hope you can help me because my custom style worked fine in previous versions (prior to the Q3 2010 release).

Thanks



0
Yordanka
Telerik team
answered on 26 Nov 2010, 03:54 PM
Hello ClausDC,

Thank you for reporting this problem.
We were able to reproduce it and we have started to work on it.
Please, excuse us for the inconvenience caused. I have updated your Telerik points.

Greetings,
Yordanka
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Patrik
Top achievements
Rank 1
answered on 02 Dec 2010, 02:05 PM
I also get this error and I have similar conditions as the poster. Just confirming to you other gets this error as well.
0
Yordanka
Telerik team
answered on 02 Dec 2010, 03:30 PM
Hello,

The exception is already fixed in our latest internal build - version .1129.

All the best,
Yordanka
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
David Bass
Top achievements
Rank 1
answered on 06 Dec 2010, 05:39 AM
I got the same results when hiding a column (by setting its 'IsVisible' property) then showing it again.  I downloaded the Latest Internal Build (v .1129) and there was no longer an issue. Thanks!

David
Tags
GridView
Asked by
ClausDC
Top achievements
Rank 1
Iron
Iron
Answers by
Yordanka
Telerik team
ClausDC
Top achievements
Rank 1
Iron
Iron
Patrik
Top achievements
Rank 1
David Bass
Top achievements
Rank 1
Share this question
or