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

LoadOnDemand and no children

6 Answers 115 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 05 Jan 2009, 01:36 PM
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

6 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 05 Jan 2009, 01:41 PM
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.
0
Tony
Top achievements
Rank 1
answered on 05 Jan 2009, 03:34 PM
I had attempted setting the items is IsLoadOnDemandEnabled = false.  The expander is still visible on these items.

Any other thoughts?
0
Valentin.Stoychev
Telerik team
answered on 05 Jan 2009, 03:38 PM
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.
0
Matthias
Top achievements
Rank 1
answered on 25 Aug 2011, 02:56 PM
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.
0
Matthias
Top achievements
Rank 1
answered on 30 Aug 2011, 08:47 AM
Anyone?
0
Petar Mladenov
Telerik team
answered on 30 Aug 2011, 02:34 PM
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 >>

Tags
TreeView
Asked by
Tony
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Tony
Top achievements
Rank 1
Matthias
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or