Completed
Last Updated: 16 Dec 2015 09:03 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 25 Mar 2015 14:51
Category: TreeView
Type: Bug Report
1
FIX. RadTreeView - wrong selection when showing a RadMessageBox in the NodeRemoving event
To reproduce: use the following code snippet and perform the illustrated steps on the attached gif file:

public Form1()
{
    InitializeComponent();

    for (int i = 0; i < 5; i++)
    {
        this.radTreeView1.Nodes.Add("Node" + i);
    }

    this.radTreeView1.NodeRemoving += radTreeView1_NodeRemoving;

    this.radTreeView1.AllowRemove = true;
    this.radTreeView1.AllowDefaultContextMenu = true;
}

private void radTreeView1_NodeRemoving(object sender, Telerik.WinControls.UI.RadTreeViewCancelEventArgs e)
{
    DialogResult result = RadMessageBox.Show(String.Format("Do you really want to remove the node '{0}'?", e.Node.Text),
        "Question", System.Windows.Forms.MessageBoxButtons.YesNo, RadMessageIcon.Question);

    if (result != System.Windows.Forms.DialogResult.Yes)
    {
        e.Cancel = true;
    }
}
Attached Files:
0 comments