Declined
Last Updated: 12 Jun 2018 08:14 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 24 May 2018 05:36
Category: TreeView
Type: Bug Report
1
FIX. RadTreeView - application hangs when showing a MS MessageBox in the DragEnding event
To reproduce: add some nodes to the tree view at design time

        public RadForm1()
        {
            InitializeComponent();

            this.radTreeView1.AllowDragDrop = true;
            this.radTreeView1.DragEnding += radTreeView1_DragEnding;
        }
        
        private void radTreeView1_DragEnding(object sender, Telerik.WinControls.UI.RadTreeViewDragCancelEventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to move?", "Question", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
            {
                e.Cancel = true;
            }
        }

Then try to drag and drop a node. You will notice that the application hangs

Workaround: use RadMessageBox
2 comments
ADMIN
Dimitar
Posted on: 12 Jun 2018 08:14
This scenario can be handled by RadMessageBox instead of the standard Microsoft MessageBox.

The standard MessageBox is being shown using a native MessageBox method imported from the user32.dll assembly.
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=false)]
public static extern int MessageBox(HandleRef hWnd, string text, string caption, int type);

In the discussed scenario calling the method above results in a state similar to an application hang. Actually the application has not frozen and the message box can be brought to front having the focus using the ALT key. The stack trace does not invole our code and the observed beahvior appears to be related to the native method. The same scenario can be handled by RadMessageBox.
Patrick
Posted on: 25 May 2018 14:14
the message box is present but hidden behind the window.  Tabbing to it causes it to show up.