We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Binding Filter Predicate to ViewModel on SfTextBoxExt

Hi,
There is a possibility to Binding my "SuggestionPredicate" located in my View model on the Filter property on SfTextBoxExt control?

Example:

 <sync:SfTextBoxExt AutoCompleteSource="{Binding Path=Installers}"
                                                SelectedItem="{Binding Installer, Mode=TwoWay}" 
                                                SuggestionMode="Custom"
                                                Filter = "{Binding Path=MyFilter}"/>


On View Model:

public SuggestionPredicate<Installer> InstallerSuggestionFilter
        {
            get
            {
                return new SuggestionPredicate<Installer>(
                (s, i) =>
                {
                    return i.Name.ToLower().Contains(s.ToLower()) && i.BusinessName.ToLower().Contains(s.ToLower());
                });
            }
        }

Thanks you.


1 Reply

KJ Keerthana Jegannathan Syncfusion Team January 11, 2017 10:54 AM UTC

Hi CSharpino,   
   
Thank you for contacting Syncfusion support.   
   
In SfTextBoxExt, “SuggestionPredicate” cannot be handled in application level but it can be invoked by writing the delegate for this. Therefore, we have prepared a sample with SfTextBoxExt in which we have assigned “SuggestionMode” property as “Custom” and written delegate named “Filter” to handle the filtering of SfTextBoxExt. Please refer the below sample and KB link for further details about Filtering concepts of SfTextBoxExt.   
   
Sample: TextBoxFilter   
   
   
Regards,   
Keerthana J   
  


Loader.
Live Chat Icon For mobile
Up arrow icon