We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Clicking Checkbox column in WPF GridDatagrid intermittently crashes my app

Thread ID:

Created:

Updated:

Platform:

Replies:

114224 Nov 6,2013 08:39 PM UTC Nov 25,2013 01:13 PM UTC WPF 1
loading
Tags: GridControl
Ankur Bhatnagar
Asked On November 6, 2013 08:39 PM UTC

I am using WPF GridDataControl from Essential Studio 2011 Vol 4. I

I have bound a WPF GridDataControl to a List<Order>. An Order object has one boolean property which renders as a CheckBox column in the GridDataControl. On the form I have a separate drop-down for Zones (North, East,West, South, etc.). At runtime, based on selected state in the drop-down, I fetch new Orders collection for that Zone and assign it to the ItemsSource property of the grid. Thus, grid shows all Orders of selected Zone at a time. The checkbox column of the grid is editable. All other columns are read-only.

Mostly checkbox works without issues. However, sometimes on clicking the checkbox in the grid following exception is raised which crashes my application. It is difficult to reproduce the issue but not impossible.

Type : System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Object reference not set to an instance of an object.
Source : Syncfusion.Grid.Wpf
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void OnClickedCheckBox(System.Windows.Controls.CheckBox)
Stack Trace :    at Syncfusion.Windows.Controls.Grid.GridCellCheckboxRenderer.OnClickedCheckBox(CheckBox checkBox)
   at Syncfusion.Windows.Controls.Grid.GridCellCheckboxRenderer.CheckBox_Unchecked(Object sender, RoutedEventArgs e)
   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.ToggleButton.OnUnchecked(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ToggleButton.OnIsCheckedChanged(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.SetCurrentValueInternal(DependencyProperty dp, Object value)
   at System.Windows.Controls.Primitives.ToggleButton.OnToggle()
   at System.Windows.Controls.Primitives.ToggleButton.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)

It is interesting to mention that if exception happens once it would then continously occur for that particular checkbox. However, if you move focus to some other grid row then it would start working for that particular ItemSource binding.

I think this is some sort of Initialization issue with the internal code. I will appreciate to know your recommedation to handle this.

Thank you!


Kasthuriraja G [Syncfusion]
Replied On November 25, 2013 01:13 PM UTC

Hi Bhatnagar,

Sorry for the inconvenience caused.

We have analyzed the reported issue with our sample, we are not able to reproduce the issue. Can you please revert us by modifying the sample based on your application along with the replication procedure. This would be helpful for us to serve you.

Sample : checkboxforum.zip

Please let us know if you have any questions.

Thanks and Regards

Kasthuriraja.G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;