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

Xaml DelegateFilterDescriptor Filter binding

1 Answer 104 Views
ListView - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Alexei
Top achievements
Rank 1
Alexei asked on 17 Nov 2016, 02:59 PM

Hi all,

Need some help with binding.

I have a page with following xaml:

 <Entry x:Name="ListFilter" />

....

<dataControls:RadListView x:Name="ItemsList" ItemsSource ="{Binding ItemsList}" >

...

     <dataControls:RadListView.FilterDescriptors>
              <listView:DelegateFilterDescriptor Filter="{Binding ....}"></listView:DelegateFilterDescriptor>
     </dataControls:RadListView.FilterDescriptors>

....

 

How could I write a binding for Filter (DelegateFilterDescriptor's property) to execute the contains predicate in xaml with parameter Entry's Text property. Equivalent to code behind expression:

ItemsList.FilterDescriptors.Add(new DelegateFilterDescriptor {Filter = (n)=>((Item)n).Name.Contains(ItemsList.Text)});

 

Thank you in advance.

Alexei

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 22 Nov 2016, 01:32 PM
Hello Alexei,

Thank you for contacting us.

This scenario is not supported. Adding a filter descriptor to the FilterDescriptors collection triggers the filtering once and any further changes in the descriptor are not regarded. You have to modify the FilterDescriptors collection to initiate new filtering. Generally, what you could do in this case is: clear the descriptors collection and add new descriptor every time the entry text is changed. I have attached an example.

I hope this helps.

Regards,
Rosy Topchiyska
Telerik by Progress
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 Feedback Portal and vote to affect the priority of the items
Tags
ListView - Xamarin.iOS
Asked by
Alexei
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or