This question is locked. New answers and comments are not allowed.
Hi,
I am trying to imitate the OrgChart example you have here OrgChart
I have succeeded to implement my own data source which passes the ObservableCollection object and represents data in diagram. However, my diagram seems never to have a tree structure even though I create a treeLayout and use the Layout method.
Here is some more details in the question here on StackOverflow question link
In particular, which parts of the code are responsible for making the RadDiagtam shapes all line up in a tree-like structure. Now, I get them all in same position (0,0).
Thanks
I am trying to imitate the OrgChart example you have here OrgChart
I have succeeded to implement my own data source which passes the ObservableCollection object and represents data in diagram. However, my diagram seems never to have a tree structure even though I create a treeLayout and use the Layout method.
Here is some more details in the question here on StackOverflow question link
In particular, which parts of the code are responsible for making the RadDiagtam shapes all line up in a tree-like structure. Now, I get them all in same position (0,0).
Thanks
7 Answers, 1 is accepted
0
Accepted
Hi Saher,
We already answered to this question in StackOverflow. I'm posting the answer here too:
Regards,
Petar Mladenov
Telerik
We already answered to this question in StackOverflow. I'm posting the answer here too:
Basically you have two options for such issues:
- Add Style for the Shapes that sets default Width and Height of the Shapes. If this does not fill well in your scenario:
- Try invoking the Layout in Dispatcher.BeginInvoke
Dispatcher.BeginInvoke(() => this.treeLayout.Layout(...)
In addition, I want to mention that we are currently working on improving the Layout mechanism. Our goal is to provide a LayoutAsync() public method that will ensure internally that the shapes are measured and this way the layout will be successful. This will eliminate the current need of workarounds mentioned above.Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
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 >>
0

Saher
Top achievements
Rank 1
answered on 16 Jul 2013, 04:48 PM
Hello Petar,
Thanks a lot! The second option worked perfectly! I appreciate your help.
Thanks a lot! The second option worked perfectly! I appreciate your help.
0

Saher
Top achievements
Rank 1
answered on 19 Jul 2013, 04:45 PM
Hello Petar,
For this option:
How can I make this work in WPF?
Currently I have this working in Silverlight:
I get the tree structure. While when I link a WPF project, I get all the nodes stacked on top of each other. The structure is fine when you move them around, but I want them to show the layout when action is invoked.
Thanks
For this option:
Dispatcher.BeginInvoke(() => this.treeLayout.Layout(...)
How can I make this work in WPF?
Currently I have this working in Silverlight:
Action action = new Action(() => treeLayout.Layout(this.diagram, dataModel.ChildTreeLayoutViewModel.CurrentLayoutSettings));
this.Dispatcher.BeginInvoke(action);
Thanks
0
Hello Saher,
Petar Mladenov
Telerik
In WPF you can use the second parameter of the BeginInvoke method. You can set it to DispatcherPriority.ApplicationIdle or DispatcherPriority.Loaded. The good news is that we have worked on improving this mechanism and in Q2 2013 SP that is right at the door you will be able to simply use LayoutAsync method instead of Dispatchers for both SL and WPF.
Regards,Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
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 >>
0

Saher
Top achievements
Rank 1
answered on 22 Jul 2013, 05:10 PM
Hi
I should have mentioned that I tried that before but DispatcherPriority was not recognized even though I had :
Remember, I am building a Silverlight project (user controls), and I am linking a WPF project to it, so I don't have to duplicate cs code or xaml. Does the DispatcherPriority only appear in WPF project and not in Silverlight?
Thanks,
Saher
I should have mentioned that I tried that before but DispatcherPriority was not recognized even though I had :
using System.Windows.Threading;
Remember, I am building a Silverlight project (user controls), and I am linking a WPF project to it, so I don't have to duplicate cs code or xaml. Does the DispatcherPriority only appear in WPF project and not in Silverlight?
Thanks,
Saher
0

Saher
Top achievements
Rank 1
answered on 22 Jul 2013, 05:31 PM
Never mind I fixed that using this:
#if WPF
this.Dispatcher.BeginInvoke(action, DispatcherPriority.Background);
#else
this.Dispatcher.BeginInvoke(action);
#endif
0
Hello Saher,
Petar Mladenov
Telerik
Yes, the DispatcherPriority is available for WPF only.
Once again, please have in mind that with Q2 2013 SP, which will be available till the end of this month, you will be able to use LayoutAsync() method and the property AutoLayout = True. Let us know if you need assistance in upgrading.
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
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 >>