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

How To Prevent Extra SplitContainers?

4 Answers 54 Views
Docking
This is a migrated thread and some comments may be shown as answers.
RoadWarrior
Top achievements
Rank 1
RoadWarrior asked on 16 Feb 2010, 06:00 PM
I would like to prevent the nesting of extra RadSplitContainers a result of Drag & Drop.  Here is what I am experiencing:  When a RadPane is dragged & dropped from a ToolWindow to dock inside an existing RadSplitContainer, the existing SplitContainer will not only add the RadPaneGroup and RadPane to it's content, but will additionally include the RadSplitContainer.  For me a SplitContainer, inside a SplitContainer is unecessary and unwanted.  Why this matters becomes obvious when a Style with any significant margin is applied to the SplitContainer.  See attached image for an illustration of the issue.

Is there any fix for this?  Alternatively, let me know ft there a workaround I can do, perhaps on the PaneStateChanged event?

4 Answers, 1 is accepted

Sort by
0
RoadWarrior
Top achievements
Rank 1
answered on 17 Feb 2010, 12:08 AM
I've created a function that will remove the extra RadSplitContainer.  However, there doesn't seem to exist a sufficient event exposed to know when a ToolWiindow has been docked.  I've tried RadDocking.WindowClose, but this fires before the actual docking is complete.  If there is a better way, please let me know.
0
Miroslav Nedyalkov
Telerik team
answered on 17 Feb 2010, 02:14 PM
Hello Rick,

 You could hook up to the PaneStateChanged event - when a tool window is docked it is fired just after the docking is finished. The only problem here is that this event might be fired because of different actions (no only because the user docks something).

You could also use the WindowClose event as you noticed, but you will need to wait a little after that (us the Dispatcher.BeginIvoke method).

Hope this helps.

Greetings,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
RoadWarrior
Top achievements
Rank 1
answered on 17 Feb 2010, 02:27 PM
Actually, the PaneStateChanged also fires BEFORE the docking is complete.  So I've had to hack up a timer to delay removal of the extra SplitContainer for now.  Not a great solution. 

Here is my suggestion for what would be the correct fix.  This would have to be done by Telerik since it is your implementation of Drag & Drop behavior:

On the DropEvent, check whether the ToolWindow's SplitContainer actually contains more than 1 PaneGroup.
  • In the common case of a single group, move over only the Group and contents.
  • Only in the case of multiple items in the SplitContainer, copy the SplitContainer as you are now.

This would facilitates reordering of singular PaneGroups within a SplitContainer without creating new SplitContainers.
0
Miroslav Nedyalkov
Telerik team
answered on 17 Feb 2010, 03:08 PM
Hi Rick,

 Yes, you are right that we must implement it. I just wanted to point you quick work-around. 

Anyway thank you for your input - I will log the issue and we will fix it for one of the upcoming releases. I also added a PITS item (with ID: 57554) and associated it with your account to let you track the progress of this issue.

Your Telerik points were updated.

Sincerely yours,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Docking
Asked by
RoadWarrior
Top achievements
Rank 1
Answers by
RoadWarrior
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or