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

CancelEventArgs e.Cancel doesn't work properly for DocumentPane

3 Answers 92 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Jaroslav Bucek
Top achievements
Rank 1
Jaroslav Bucek asked on 09 Oct 2008, 11:06 AM
Hi,

when I Cancel closing of DocumentPane in Cancel event handler, it is canceled, but then it has "very interesting" behavior. When I click on another Tab of DockingManager, sometimes the DocumentPane stays in DockingManager and sometimes it disappears.

Could you check it, please?

2nd issue: how can I check if the closing was successful, when I call the Close method programatically? Could you change void Close method to it returns bool, if it was/was not closed?

TIA
Jaroslav Bucek

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 13 Oct 2008, 03:57 PM
Hello Jaroslav Bucek,

1) We made some tests for this scenario, but did not find any problems. Please send us a simple example to reproduce the problem locally. Thank you in advance.

2) To check the dockable window state, you can use the Visible or DockState == Hidden properties.

 
All the best,
Julian Benkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jaroslav Bucek
Top achievements
Rank 1
answered on 13 Oct 2008, 04:13 PM

 

public partial class Form1 : Form

 

{

 

    DockingManager mng;

 

 

    public Form1()

 

    {

        InitializeComponent();

        mng =

new DockingManager();

 

        mng.Dock =

DockStyle.Fill;

 

        mng.Parent =

this;

 

 

        for (int i = 0; i < 5; i++)

 

        {

 

            DocumentPane doc = new DocumentPane();

 

            doc.Text =

"Document" + i.ToString();

 

            doc.Closing +=

new CancelEventHandler(doc_Closing);

 

            mng.SetDocument(doc);

        }

    }

 

    void doc_Closing(object sender, CancelEventArgs e)

 

    {

        e.Cancel =

true;

 

    }

}

When you execute the code above and click on e.g. Document 4 tab using middle mouse button, then activate Document 3 by left mouse button click.

Let me know.

0
Julian Benkov
Telerik team
answered on 15 Oct 2008, 12:51 PM
Hello Jaroslav Bucek,

Thank you for the code and for reporting this issue. The fix will be available after upcoming Q3 release.

Your Telerik points have been updated.

All the best,
Julian Benkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
Jaroslav Bucek
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Jaroslav Bucek
Top achievements
Rank 1
Share this question
or