How to perform Layout but leave disconnected nodes?

6 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 25 Apr 2013 Link to this post

    When I call the Layout() method, all nodes are aligned according to the layout settings. I would like to apply this layout logic only to connected nodes. Often, I create several nodes and then start connecting them. It makes sense to align the connected ones and leave my disconnected ones unchanged - until I actually connect them too.

    As it is now, all unconnected nodes end up at the root level which is really annoying when you are working with larger trees.
  2. Francois Vanderseypen
    Francois Vanderseypen avatar
    46 posts
    Member since:
    Oct 2009

    Posted 26 Apr 2013 Link to this post

    True, indeed the layout does not give you at this moment the possibility to do this. I'll see if an overload can be added still within this Q, i.e. for next release.
    Probably the only hack right now is to make the shape you don't want to lay out invisible before calling Layout() and turn them back on thereafter. The layout does not take the hidden shape into account.

    Thanks for this feedback, Fr.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 12 Jun 2013 Link to this post

    Will this be fixed in the Q2 release?
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Jun 2013 Link to this post

    Hello Kristoffer,

    We haven't included such changes within the layout mechanism so far. However, we logged your suggestion in our PITS where you can vote for it in order to increase its priority and you can also track its progress.

    I also updated your Telerik account for sharing your feedback.

    Regards,
    Tina Stancheva
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 04 Sep 2013 Link to this post

    Wouldn't it be possible to achieve this using a ContainerGraph?

    I'm thinking of something like this:
    var container = new ContainerGraph<TreeLayoutData, object>();
    // Set up container somehow...
    treeLayout.Layout(container, layoutSettings);

    I'm not sure how I would set up the container, but adding all connected nodes would be a first step. Ideas?
  7. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 06 Sep 2013 Link to this post

    Hi Kristoffer,

    Thank you for your suggestion. We would definitely take it into consideration. There are several possible approaches here.
    One would be to use some kind of connected graphs (like you are suggesting with the container graph) and pass those graphs to the layout. Personally I think this would be the most convenient way to customize the layout. Of course a default or empty container/graph could be used to layout all shapes.

    Another approach would be to provide some kind of descriptor. The descriptor could be accountable to define how different types of shapes should be handled.
    Also a protected method on the layout also could be exposed in order to customize the items collections before layout happens.

    However, we would have to evaluate each one of them before implementing the most appropriate one. Currently I am not able to state which approach is going to be implemented.

    Please let us know if you have more feedback or ideas on the topic.

    Regards,
    Hristo
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready