This is a migrated thread and some comments may be shown as answers.
How to perform Layout but leave disconnected nodes?
5 Answers 29 Views
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 25 Apr 2013, 03:52 PM
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.

5 Answers, 1 is accepted

Sort by
0
Francois Vanderseypen
Top achievements
Rank 2
answered on 26 Apr 2013, 06:13 AM
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.
0
Kristoffer
Top achievements
Rank 1
answered on 12 Jun 2013, 12:51 PM
Will this be fixed in the Q2 release?
0
Tina Stancheva
Telerik team
answered on 17 Jun 2013, 02:29 PM
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.

0
Kristoffer
Top achievements
Rank 1
answered on 04 Sep 2013, 07:48 AM
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?
0
Hristo
Telerik team
answered on 06 Sep 2013, 02:03 PM
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 >>
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Francois Vanderseypen
Top achievements
Rank 2
Kristoffer
Top achievements
Rank 1
Tina Stancheva
Telerik team
Hristo
Telerik team
Share this question
or