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

PaneStateChange event on adding new pane

2 Answers 106 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nikita
Top achievements
Rank 1
Nikita asked on 02 Mar 2015, 08:03 AM
I have a simple pane factory which basically looks like this:

class PaneFactory : DockingPanesFactory
{
    protected override void AddPane(RadDocking radDocking, RadPane pane)
    {
        //Docking is UserControl, which contains RadDocking
        var docking = radDocking.ParentOfType<Docking>();
        var settings = pane.Tag as PaneSettings;
 
        if (settings.ScreenPosition == ScreenPosition.Left)
        {
            //LeftPaneGroup is pane group declared in xaml (docked to left side)
            docking.LeftPaneGroup.AddItem(pane, DockPosition.Center);
        }
        else
        {
            //DocumentPaneGroup is document host declared in xaml
            docking.DocumentPaneGroup.AddItem(pane, DockPosition.Center);
        }
    }
}

So there are two options: pane is either initially docked to the left or to the document host. If it is docked to document host - PaneStateChange
event is fired, but if it is docked to the left - there is no event. Is this a bug or an expected behaviour? Looks really inconsistent to me. Is there a way to force PaneStateChange event to always fire, when new pane is added?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 04 Mar 2015, 04:46 PM
Hello Nikita,

We understand your concerns, however with the current implementation of RadDocking when a Pane is added inside the DocumentHost it is considered as if it's state is being changed- thus the PaneStateChaged is fired. We will consider if that behavior should be improved for one of our future releases of the controls.

We hope the provided information will help you. Please, do not hesitate to contact if you have any additional questions or concerns.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Nikita
Top achievements
Rank 1
answered on 05 Mar 2015, 12:12 PM
Pretty wierd. But oh well.

Adding pane to document host, and then instantly moving it to target pane group seems to guarantee that the event is fired. Although it fires twice in that case (which is not a problem for me). There is probably some performance hit in this scenario, but it is not noticable so far, so I went with that workaround.
Tags
Docking
Asked by
Nikita
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Nikita
Top achievements
Rank 1
Share this question
or