Treeview node visible or filter

5 posts, 0 answers
  1. Kim
    Kim avatar
    3 posts
    Member since:
    Apr 2015

    Posted 19 Dec 2016 Link to this post

    I would like to hide/unhide nodes based on a bound data source item value.  In my sample project, I can assign a full data source and a filtered data source from 'All Data Source' button click or 'Filtered Data Source' button click. But hide and unhide using the node visible property in radTreeView1_NodeFormatting event triggered from the 'Visible = Primary (Hide)' and 'All Visible Unhide' don't work.  Also, the first click of 'Visible=Primary(Hide)' only formats the first 5 nodes.  It seems once a node's visible property is false, you can not set it to true programmatically.  I do not want to refresh or reload the tree view. 

    It would be really great if there was some way to filter tree view based on Tag versus Text property.  Then I could simply populate the tag with true or false and filter.

     

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 20 Dec 2016 Link to this post

    Hello Kim,

    Thank you for writing.  

    RadTreeView uses virtualization. Its visual node elements are created only for the visible nodes and are being reused during operations like scrolling. That is why if you use the NodeFormatting event to style the visual elements, it is necessary to reset the style for the rest of the nodes in order to avoid incorrect style for unexpected nodes.

    As to the filtering, note that RadTreeView supports custom filtering which is a flexible mechanism for filtering RadTreeView nodes by using custom logic. It has a higher priority than the applied FilterDescriptors. Additional information is available in the following help article: http://docs.telerik.com/devtools/winforms/treeview/working-with-nodes/custom-filtering

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Kim
    Kim avatar
    3 posts
    Member since:
    Apr 2015

    Posted 21 Dec 2016 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Your example is filtering on text property of node.  I'd like an example filtering on tag property.

    Thanks!

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 22 Dec 2016 Link to this post

    Hello Kim, 

    Thank you for writing back. 
     
    The referred help article demonstrates a sample approach how to perform custom filtering in RadTreeView. The FilterPredicate property allows you to determine which nodes to be visible according to custom logic. Indeed, in the example it is used the Text property. However, you are free to use the RadTreeNode's Tag or DataBoundItem properties or any other property that is useful for determining whether a node is visible or not.
     
    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Kim
    Kim avatar
    3 posts
    Member since:
    Apr 2015

    Posted 13 Jan 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Able to filter on underlying data bound item as I needed.  Thanks!

Back to Top