LoadOnDemand and no children

7 posts, 0 answers
  1. Tony
    Tony avatar
    5 posts
    Member since:
    Apr 2008

    Posted 05 Jan 2009 Link to this post

    I have a treeview with the IsLoadOnDemanEnabled set to true in order to populate each layer via a WCF service.

    When I get down to the last level, I want to set the items to have no children, thus eliminating the expander.  I've tried this a number of ways and have been unsuccessful.

    Any pointers would be greatly appreciated.

    Thanks,
    Tony
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 05 Jan 2009 Link to this post

    Hi Anthony,

    try setting the IsLoadOnDemandEnabled to false to the items that don't have children. This will eliminate the expander icon.


    Greetings,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Tony
    Tony avatar
    5 posts
    Member since:
    Apr 2008

    Posted 05 Jan 2009 Link to this post

    I had attempted setting the items is IsLoadOnDemandEnabled = false.  The expander is still visible on these items.

    Any other thoughts?
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 05 Jan 2009 Link to this post

    Hello Anthony,

    This looks like a bug. Can you send us the project where we can investigate the issue?

    All the best,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Matthias
    Matthias avatar
    26 posts
    Member since:
    Apr 2011

    Posted 25 Aug 2011 Link to this post

    Same issue here with a databound RadTreeView.

    I am developing both for Silverlight and WPF. In WPF it works fine.
    In Silverlight I use containerbinding to link to my ViewModel.
    <telerik:ContainerBindingCollection>
       <telerik:ContainerBinding PropertyName="IsLoadOnDemandEnabled" Binding="{Binding IsLoadOnDemandEnabled, Mode=TwoWay}"/>
       <telerik:ContainerBinding  PropertyName="IsSelected" Binding="{Binding IsSelected, Mode=TwoWay}"/>
       <telerik:ContainerBinding  PropertyName="IsExpanded" Binding="{Binding IsExpanded, Mode=TwoWay}"/>
                   </telerik:ContainerBindingCollection>

    However, the expander item is still there.
    When load is triggered and I debug into my ViewModel, I can see that IsLoadOnDemandEnabled is false.
  7. Matthias
    Matthias avatar
    26 posts
    Member since:
    Apr 2011

    Posted 30 Aug 2011 Link to this post

    Anyone?
  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 30 Aug 2011 Link to this post

    Hello Matthias,

     Setting the IsLoadOnDemand enabled to true guarantees only that when a RadTreeVewiItem is being expanded, the LoadOnDemand events of the RadTreeView and the RadTreeViewItem will fire. Setting this property to false guarantees that these events will not fire. When you want to remove/change the expander ToggleButton in the RadTreeViewItem  , you have to play with the ExpanderStyle property. Please check out this blog post which is a very good starting point. Do not hesitate to ask if you need further assistance.

    Best wishes,
    Petar Mladenov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
DevCraft banner