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

The expand icons from Code Behind

4 Answers 61 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
David Cardona
Top achievements
Rank 1
David Cardona asked on 03 May 2010, 10:38 PM
Hello!

We need to show or hide the expand icon of the TreeListView from Code Behind, is that posible ?

I atach a image that show what is the expand icon!

Thank you so much.

4 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 05 May 2010, 03:19 PM
Hello David Cardona,

Are you using LoadOnDemand? Then you can set the IsLoadOnDemand property for the particular item to false.

Otherwise this will not be a trivial task since the TreeView manages the visibility of the expand button based on the content of its items. Ultimately  you may need to retrieve the button from the RadTreeListviewRow template and hide it manually.

We are currently working on improving the TreeListView. May you help us by sharing your scenario in this case - why you need to selectively hide / show the expander?

Best wishes,
Miroslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Cardona
Top achievements
Rank 1
answered on 05 May 2010, 07:58 PM
Thank you Miroslav.

Well my scenario is any complicated to explain it, but I will try:

I need that because initially I don´t need fill each Item...I know if these elements have childs in a Object property, then in that case I need show the expand icon, else I don´t  like show the expand icon. Then, when raise the expand event I fill the Node.

it's clear?

I don't use the LoadOnDemand property  because it show all items with expand icon.

Thank you so much
0
Accepted
Miroslav
Telerik team
answered on 06 May 2010, 02:32 PM
Hi David Cardona,

The LoadOnDemand can work in your scenario.

When you set the IsLoadOnDemandEnabled on the TreeView it gets inherited for all TreeViewItems.

If you know that an item will not have children, you can sets its IsLoadOnDemandEnabled property to false (this can happen in the ItemPrepared event of the TreeView for example).

Then you just need to handle the LoadOnDemand event which supplies you with the item that is being expanded. You can start an async retrieval and populate the item's children when you have the result.

More information is available here:

http://www.telerik.com/help/silverlight/radtreeview-features-load-on-demand.html

I am also attaching a sample project that demonstrates this with LoadOnDemand.

Greetings,
Miroslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Cardona
Top achievements
Rank 1
answered on 06 May 2010, 04:22 PM
Miroslav thank you so much.

That was the solution :)
Tags
TreeListView
Asked by
David Cardona
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
David Cardona
Top achievements
Rank 1
Share this question
or