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

Custom Filtering

1 Answer 135 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 02 Jun 2014, 09:05 AM
Hi,

I have applied custom filtering on the Treeview on Drop down selection change. Let's say I have applied filter to show only checked nodes and it did only showed me checked nodes. After filtering I unchecked one or more nodes but It didn't hide them so I figured that I might have to apply Filter on it again which I did but it didn't applied any filter nor did it go to the Filter Function that I have linked to it as well. Al thought it's working from UI.

Here's my code:

TreeView.TreeViewElement.FilterPredicate = FilterNode;


private bool FilterNode(RadTreeNode node)
 {
            bool filter = false;
            //Code 
            return filter;
 }

//For applying the filter

TreeView.Filter = string.Empty;
TreeView.Filter = "Custom";

Let me know if that makes any sense.

Thanks,
Attiqe







1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 04 Jun 2014, 02:51 PM
Hello Attiqe,

Your question has already been answered in the support thread you have opened. Nevertheless I am copying the answer here in order the community to benefit from it:

If you are triggering the custom filtering functionality in an event like NodeCheckedChanged you should enclose the filter reset in a Begin\End Update block. This will trigger an explicit nodes update and the filter will be applied again: 
radTreeView1.BeginUpdate();
this.radTreeView1.Filter = "";
this.radTreeView1.Filter = "Custom";
radTreeView1.EndUpdate();

If you have any questions, please do not hesitate to contact us.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Treeview
Asked by
David
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or