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

Problem with "Check All" in the header cell for a GridViewCheckBoxColumn

3 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 06 Sep 2013, 09:25 PM
I've got a problem with the VB version of the Check All code from the knowledge base:

http://www.telerik.com/support/kb/winforms/gridview/add-check-uncheck-all-check-box-in-the-header-cell.aspx

The difference in my case is that I add the column programmatically to a grid, and it's the last column in the grid.

The code works great unless the grid view is wide enough to cause a horizontal scroll bar. When I scroll sideways, back and forth a few times, I get a NullReferenceException when trying to check or uncheck a check box on an individual record. Screenshot of error below. Full stacktrace is below. 

Anyone else have this problem? Any suggestions?

System.NullReferenceException was unhandled
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=ProductPricingModeller.WinForms
  StackTrace:
       at ProductPricingModeller.WinForms.UseCurrentPriceHeaderCellElement.GridControl_ValueChanged(Object sender, EventArgs e) in E:\CODE\JssProductPricingModeller\ProductPricingModeller.WinForms\UseCurrentPriceHeaderCellElement.vb:line 201
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at Telerik.WinControls.UI.RadGridView.OnValueChanged(Object sender, EventArgs e)
       at Telerik.WinControls.UI.EventDispatcher.RaiseEvent[T](Object eventKey, Object sender, T args)
       at Telerik.WinControls.UI.BaseGridEditor.OnValueChanged()
       at Telerik.WinControls.UI.RadCheckBoxEditor.SetValue(Object value)
       at Telerik.WinControls.UI.RadCheckBoxEditor.set_Value(Object value)
       at Telerik.WinControls.UI.RadCheckBoxEditor.ToggleState()
       at Telerik.WinControls.UI.RadCheckBoxEditorElement.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadElement.OnCLREventsRise(RoutedEventArgs args)
       at Telerik.WinControls.RadElement.OnBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.OnBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadElement.CallDoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.UI.RadGridView.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at ProductPricingModeller.WinForms.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 11 Sep 2013, 12:39 PM
Hello Robert,

Thank you for writing.

I tried to reproduce the problem locally but to no avail – everything is working as expected on my side. I have downloaded the demo from the article and I have docked the grid to the form so I can resize it until the horizontal scroll appears. I also have moved the checkbox column as last. I have attached the demo to this thread, could you please check it and let me know how it differs from your real setup?

I am looking forward to your reply.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
SAM
Top achievements
Rank 1
answered on 31 Oct 2013, 06:01 AM
Hi Stefan,

Gone through the example provided by you. Still the problem persist. if you resize your grid and allow horizontal scroll bar to come, then the similar problem occurs again.

need you help with example.
0
Dimitar
Telerik team
answered on 01 Nov 2013, 02:58 PM
Hi Robert,

Thank you for writing back.

If you experience the issue in the project I send you than maybe something else is different. This is why I kindly ask you to specify the exact version of our controls that you are using. Also could you please specify the exact steps needed for reproducing the issue one more time (maybe I am missing something).

Thank you in advance for your patience and cooperation.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Robert
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
SAM
Top achievements
Rank 1
Share this question
or