Completed
Last Updated: 12 Jun 2020 16:01 by ADMIN
Release R2 2020 SP1
Rene
Created on: 14 May 2020 08:30
Category: TreeView
Type: Bug Report
0
RadTreeView: Exception is thrown when double click on RadTreeNode and choose a file from the open file dialog
Hi Guys,


I'm crashing an app with TreeViewControl when open dialog is shown and you double click on file in that dialog and file current location is above treeview nodes.

Added example and animated gif so you can also try.

 

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.RadTreeViewElement.FindSelectionStartAndEndNodes(RadTreeNode nodeUnderMouse, RadTreeNode& fromNode, RadTreeNode& toNode)
   at Telerik.WinControls.UI.RadTreeViewElement.ProcessMouseSelection(Point location)
   at Telerik.WinControls.UI.RadTreeViewElement.ProcessMouseMove(MouseEventArgs e)
   at Telerik.WinControls.UI.RadTreeView.OnMouseMove(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at Telerik.WinControls.UI.RadTreeView.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

Best regards

Rene
Attached Files:
1 comment
ADMIN
Nadya
Posted on: 14 May 2020 10:27

Hello Rene,

I was able to reproduce this. To workaround this issue please refer to the following code snippet:

 class CustomTreeViewElement : RadTreeViewElement
    {

        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(RadTreeViewElement);
            }
        }
        protected override bool ProcessMouseMove(MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                return true;
            }
            return base.ProcessMouseMove(e);
        }
    }

    class CustomTreeView : RadTreeView
    {
        protected override RadTreeViewElement CreateTreeViewElement()
        {
            return new CustomTreeViewElement();
        }

        public override string ThemeClassName
        {
            get
            {
                return typeof(RadTreeView).FullName;
            }
        }
    }

I hope this helps. 

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Attached Files: