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

Set IsLoadOnDemandEnabled through Binding

7 Answers 147 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Mike Hanson
Top achievements
Rank 1
Mike Hanson asked on 25 Jul 2008, 04:53 PM
I am using the TreeView for Silverlight to implement a HierarchicalGrid through templates. This has been much easier than I thought, great lookless support in this control thanks.

My data object has a HasChildren property and I want to be able to set something in my template to bind the value of this Property to the IsLoadOnDemandEnabled property of the containing RadTreeViewItem for objects.  Is this possible and what is the syntax please?

I know I can do it in code behind, but I would rather build this into the template if at all possible.

7 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 28 Jul 2008, 08:02 AM
Hello Michael,

Unfotunately this is a limitation in the current Silverlight version - this scenario is supported in WPF, but not in Silverlight.

Why you just do not set the IsLoadOnDemandEnabled property to the RadTreeView? It will take care to set the "expander image" on the nodes that do not have children.


Best wishes,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike Hanson
Top achievements
Rank 1
answered on 28 Jul 2008, 10:47 AM
I have done that for now, and have handled the situation in code behind, but I was hoping to provide a more elegant solution where the expand button is not displayed when a node has zero children.

Mike
0
Valentin.Stoychev
Telerik team
answered on 28 Jul 2008, 10:54 AM
Hi Michael,

Lets hope that in the next version of the Silverlight framework this will be possible, because it will give us a lot of new possibilities.

Thanks for the feedback!

Regards,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Nitin
Top achievements
Rank 1
answered on 05 Aug 2008, 04:46 AM
Hi Micheal,

Can you please share the hierarchal tree view code with me?
0
Mike Hanson
Top achievements
Rank 1
answered on 06 Aug 2008, 03:33 PM
Nitin

I can't share the actual code with you as it is for a client and I am under NDA, but I will knock up a seperate sample in the next few days and post it here.

Basically though I have defined a custom ItemTemplate with a DataTemplate.  The template comprises a StackPanel with Orientation set to Horizontal then a Border for each column containing a TextBlock for the value.  The Border is styled to look like a table cell.

In mine I set the ItemsIndent to 0 so that all nodes remain flush to the left side and I enabled LoadOnDemand at the TreeView level and loaded child rows/nodes on demand.

Mike
0
Nitin
Top achievements
Rank 1
answered on 07 Aug 2008, 02:16 AM
Hi micheal,

Thanks for your input, i have been able to develop an orginazational map hierarchy structure, now i would like to have a zoom option enabled too. How can i do that ??
0
Glenn
Top achievements
Rank 1
answered on 07 Aug 2008, 02:47 AM
Apologies, Nitin is working with me, please refer to the other posting which covers off the question about zooming in more detail. (http://www.telerik.com/community/forums/thread/b311D-bkegch.aspx)

Glenn.
Tags
TreeView
Asked by
Mike Hanson
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Mike Hanson
Top achievements
Rank 1
Nitin
Top achievements
Rank 1
Glenn
Top achievements
Rank 1
Share this question
or