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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding Filter Predicate to ViewModel on SfTextBoxExt

Thread ID:

Created:

Updated:

Platform:

Replies:

128247 Jan 10,2017 08:01 PM UTC Jan 11,2017 10:54 AM UTC WPF 1
loading
Tags: SfTextBoxExt
CSharpino
Asked On January 10, 2017 08:01 PM UTC

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.


Keerthana Jegannathan [Syncfusion]
Replied On 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   
  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;