Completed
Last Updated: 27 Nov 2014 14:44 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 11 Nov 2014 13:46
Category: Dock
Type: Bug Report
0
FIX. RadDock - Redocked DocumentWindow can not be selected
To reproduce :
1. Add three DocumentWindows.
2. Dock one of the windows to the top of the container.
3. The ActiveWindowChanged event is  fired but the window is not marked as active. Clicking on this window does not take affect and it is still not activated.

Please refer to the attached gif file.

Workaround:

public Form1()
{
    InitializeComponent();
    this.radDock1.ActiveWindowChanged += radDock1_ActiveWindowChanged;
    this.radDock1.DockStateChanged += radDock1_DockStateChanged;
}

private void radDock1_ActiveWindowChanged(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
{
    UpdateSelectedFont(e);
}

private void radDock1_DockStateChanged(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
{
    if (e.DockWindow.DockState == Telerik.WinControls.UI.Docking.DockState.Docked)
    {
        UpdateSelectedFont(e);
    }
}

private void UpdateSelectedFont(DockWindowEventArgs e)
{
    foreach (DockWindow dw in this.radDock1.DockWindows.DocumentWindows)
    {
        if (dw.TabStripItem.Text == e.DockWindow.TabStripItem.Text)
        {
            dw.TabStripItem.Font = new Font(dw.TabStripItem.Font, FontStyle.Bold);
        }
        else
        {
            dw.TabStripItem.Font = new Font(dw.TabStripItem.Font, FontStyle.Regular);
        }
    }
}
Attached Files:
0 comments