Completed
Last Updated: 13 Jul 2015 12:17 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 28 Apr 2015 10:55
Category: Dock
Type: Bug Report
1
FIX. RadDock - ActiveWindowChanged event is not fired in MDI scenario when more than 1 RadDock controls are available
To reproduce:

1. Add two RadDock controls on the form and one RadButton.
2. Use the following code snippet:

public Form1()
{
    InitializeComponent();

    this.IsMdiContainer = true;
    this.radDock1.AutoDetectMdiChildren = true;
    this.radDock2.AutoDetectMdiChildren = false;

    this.radDock1.ActiveWindowChanged += radDock1_ActiveWindowChanged;
}

private void radButton1_Click(object sender, EventArgs e)
{
    RadForm f = new RadForm();
    f.MdiParent = this;
    f.Show();
    f.Text = DateTime.Now.ToLongTimeString();
}

private void radDock1_ActiveWindowChanged(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
{
    Console.WriteLine("ActiveWindowChanged");
}

If you click the button you will notice that the last added DocumentWindow is not active.

Workaround:  this.radDock1.DockWindowAdded += radDock1_DockWindowAdded;

private void radDock1_DockWindowAdded(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
{
     this.radDock1.ActiveWindow = e.DockWindow;
}
0 comments