Set IsLoadOnDemandEnabled through Binding

8 posts, 0 answers
  1. Mike Hanson
    Mike Hanson avatar
    25 posts
    Member since:
    Jul 2005

    Posted 25 Jul 2008 Link to this post

    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.
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 28 Jul 2008 Link to this post

    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.
  3. Mike Hanson
    Mike Hanson avatar
    25 posts
    Member since:
    Jul 2005

    Posted 28 Jul 2008 Link to this post

    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
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 28 Jul 2008 Link to this post

    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.
  5. Nitin
    Nitin avatar
    2 posts
    Member since:
    Aug 2008

    Posted 04 Aug 2008 Link to this post

    Hi Micheal,

    Can you please share the hierarchal tree view code with me?
  6. Mike Hanson
    Mike Hanson avatar
    25 posts
    Member since:
    Jul 2005

    Posted 06 Aug 2008 Link to this post

    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
  7. Nitin
    Nitin avatar
    2 posts
    Member since:
    Aug 2008

    Posted 06 Aug 2008 Link to this post

    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 ??
  8. Glenn
    Glenn avatar
    9 posts
    Member since:
    Jul 2008

    Posted 06 Aug 2008 Link to this post

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