How To Prevent Extra SplitContainers?

5 posts, 0 answers
  1. RoadWarrior
    RoadWarrior avatar
    45 posts
    Member since:
    Jan 2010

    Posted 16 Feb 2010 Link to this post

    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?

  2. RoadWarrior
    RoadWarrior avatar
    45 posts
    Member since:
    Jan 2010

    Posted 16 Feb 2010 Link to this post

    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.
  3. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 17 Feb 2010 Link to this post

    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.
  4. RoadWarrior
    RoadWarrior avatar
    45 posts
    Member since:
    Jan 2010

    Posted 17 Feb 2010 Link to this post

    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.
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 17 Feb 2010 Link to this post

    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.
Back to Top