I am using TreeviewAdv, When I am clicking treeview checkbox(vaules loaded in gridview) using space button in keyboard causing error

When I try to check/uncheck parent item means, child item will not be checked\unchecked..

If I tried to Uncheck\Check the cparent node when checking\unchecking child node, object null reference exception is thrown. Below are the call stack

Error :

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Windows.Forms.Tools.TreeViewAdv.OnKeyDown(KeyEventArgs e)

   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)

   at System.Windows.Forms.Control.WmKeyChar(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)

   at Syncfusion.Windows.Forms.Tools.TreeViewAdv.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Is it possible to provide proactive null checks there?




Attachment: TreeViewAdv_8db8fa60.7z

4 Replies

EM Elakkiya Muthukumarasamy Syncfusion Team December 7, 2021 01:02 PM UTC

Hi Deepa, 
  
Greetings from Syncfusion. 
  
We are unnable to reproduce the reported issue “Null exception thrown while clicking TreeViewAdv checkbox using space button” in your provided sample with 19.3.0.57 version. From your update we suspect that this exception occurred while unclick the parent node and try to clicking the child node/ click the parent node and try to unclicking the child node and prepared the video for the same. 
  
  
Please check the video and confirm us our replication is same us yours. If not please share the replication video or steps and share the syncfusion assembly version which you have used in your project. These details will helpful for us to provide the prompt solution on this. 
  
Regards, 
Elakkiya 



DS Deepa Soundararajan replied to Elakkiya Muthukumarasamy December 14, 2021 12:52 PM UTC

Hi Elakkiya,

Thanks, Sharing your comments,

Actually, I am using the TreeviewAdv base class.  Whenever we check/uncheck " Event_AfterInteractiveChecks"
event is called. 
This method is responsible for handling the display of the selection in tree view.

There are couple of ways we can check/uncheck the treeview. One is through mouse click and other is through space bar. In both the ways, Event_ AfterInteractiveChecks method is called. During mouse click, it is called through the event OnMouseDown as per the below call stack and there is no issues.

Click Mouse.PNG

During space bar, it is called through the event OnKeyDown. the treeview we select treeview and we press the space bar on keyboard, 

If the checkboxes property is set to true and the handled property is set to false, the OnKeyDown method switches between selecting and clearing the check box when the user presses the SPACEBAR.

 Using Space Bar.PNG 

as per the above  call stack, and   throw an error in 


Error :

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Windows.Forms.Tools.TreeViewAdv.OnKeyDown(KeyEventArgs e)

   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)

   at System.Windows.Forms.Control.WmKeyChar(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)

   at Syncfusion.Windows.Forms.Tools.TreeViewAdv.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


It is throwing the exception from syncfusion code. Once the Event_AfterInteractiveChecks method is finished, we are getting the exception.



TB Thirupathi Bala Krishnan Syncfusion Team December 15, 2021 07:26 PM UTC

Hi Deepa,

Thanks for the update.

Currently we are validating the reported query in our end. We’ll provide the further details on December 16, 2021. We appreciate your patience until then.

Regards,
Thirupathi B.


TB Thirupathi Bala Krishnan Syncfusion Team December 17, 2021 07:37 AM UTC

Hi Deepa,  
  
We are unable to reproduce this issue at our end. The AfterInteractiveChecks event was called through the event OnKeyDown while we press the space bar on keyboard as like yours. But the null exception did not reproduce our side both 19.3.0.57 version and 9.3.0.61 version. Moreover  in your update you have mentioned that you are setting Handled property as false. Can you please share the exact location (file location in your sample) which you have used this property? We checked the issue in above versions based on your download history. Please let me know if you're using any other versions. Based on your updates, we’ll proceed further. 
  
Regards,  
Thirupathi B. 


Loader.
Up arrow icon