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

treeview.Edited Event Cant make modal dialog

1 Answer 73 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Ji -Won
Top achievements
Rank 1
Ji -Won asked on 02 Aug 2012, 02:49 AM
Hello..
I tried MessageBox or InstanceForm.showDialog that couldn work at Edited Event.

this is Sample Code.
radTreeView1_Edited(object sender, TreeNodeEditedEventArgs e)
{
    DialogResult result = MessageBox.Show("will you change?","Change",MessageBoxButtons.OkCancel);
    if(result != DialogResult.Ok)
    {
        e.cancel=true;
    }
}

at MessageBox.Show Line make Error Message.
attatch file is that window  


So I tried make new thread and give to delay.. but that way 
also if delay is so short or
when that action time
if I minimize or doesn focus.
that showed me similar Error.
Plz Give me a Solution.....

Thanks.

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 06 Aug 2012, 01:52 PM
Hello,

Thank you for writing.

The illustrated behavior occurs because you are causing the tree view control to loose its focus in the Editing event. You can work around it by creating custom tree view in the following manner:
public class MyTreeView : RadTreeView
{
    public MyTreeView()
    {
        this.ThemeClassName = typeof(RadTreeView).FullName;
    }
 
    protected override void OnLostFocus(System.EventArgs e)
    {
        
    }
}

I hope this helps. Let us know if you have any other questions.

Regards,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Treeview
Asked by
Ji -Won
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or