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

RadDock and DocumentWindow problem

1 Answer 150 Views
Dock
This is a migrated thread and some comments may be shown as answers.
FrancoP
Top achievements
Rank 1
FrancoP asked on 06 Nov 2009, 05:14 PM

Good morning.

            I have a problem with the DocumentWindow in your RadDock class. I downloaded your RadControls for WinForms Q3 2009 release. I did the following steps:

 

  1. New project, WindowsForm Application (with Visual Basic 2008 Express Edition).
  2. Insert a RadDock.
  3. Insert a RadMenu, one item only (“Add”).
  4. Here is the code in the form:

 

Imports Telerik.WinControls.UI.Docking

 

Public Class Form1

 

  Private Sub RadMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadMenuItem1.Click

    RadDock1.Visible = False

 

    Dim docW As DocumentWindow = New DocumentWindow("Test")

    Dim pnl As New Panel

    pnl.BorderStyle = BorderStyle.FixedSingle

    pnl.Dock = DockStyle.Fill

    docW.Controls.Add(pnl)

    RadDock1.AddDocument(docW)

 

    RadDock1.Visible = True

  End Sub

End Class

 

I programmatically insert a new DocumentWindow with a Panel in it. If you omit instruction “RadDock1.Visible = False”, all is ok, otherwise the panel will overlap the tab. If you click the small down arrow on the right (it’s almost invisible) and select the window (Test), all returns ok.

In my application, obviously much more complicated, I need to make invisible the RadDock during certain operations. What can I do to solve this problem?

 

Thank you.

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 11 Nov 2009, 12:51 PM
Hi FrancoP,

Thank you for contacting us.

Because the DocumentTabStrip is hidden when a document is added, a layout pass is not triggered and that is why the panel is not positioned properly. What you can do is after displaying RadDock to explicitly perform such layout pass:

private void radMenuItem2_Click(object sender, EventArgs e)
{
    this.radDock1.Visible = false;
    DocumentWindow doc = new DocumentWindow("Test");
    Panel p = new Panel();
    p.BorderStyle = BorderStyle.FixedSingle;
    p.Dock = DockStyle.Fill;
    p.Parent = doc;
    this.radDock1.AddDocument(doc);
    this.radDock1.Visible = true;
    doc.DockTabStrip.PerformLayout();
}

This will ensure that the layout is performed as needed.

I hope this helps. Do not hesitate to contact us if you have other questions.


Greetings,
Georgi
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Dock
Asked by
FrancoP
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or