The expand icons from Code Behind

5 posts, 1 answers
  1. David Cardona
    David Cardona avatar
    20 posts
    Member since:
    Mar 2010

    Posted 03 May 2010 Link to this post

    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.
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 05 May 2010 Link to this post

    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.
  3. DevCraft banner
  4. David Cardona
    David Cardona avatar
    20 posts
    Member since:
    Mar 2010

    Posted 05 May 2010 Link to this post

    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
  5. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 06 May 2010 Link to this post

    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.
  6. David Cardona
    David Cardona avatar
    20 posts
    Member since:
    Mar 2010

    Posted 06 May 2010 Link to this post

    Miroslav thank you so much.

    That was the solution :)
Back to Top
DevCraft banner