Loading...
Loading...
Guide implementation of the Syncfusion WinUI AutoComplete control (SfAutoComplete) for creating searchable dropdowns with single or multiple selection, filtering suggestions, and customizable token display. Use this skill when implementing search-as-you-type functionality, autocomplete dropdowns with multi-select, tagging systems with token/chip display, or filtered suggestion boxes in WinUI applications.
npx skill4agent add syncfusion/winui-ui-components-skills syncfusion-winui-autocompleteSfAutoCompleteSyncfusion.Editors.WinUISyncfusion.UI.Xaml.EditorsSfAutoComplete<Window xmlns:editors="using:Syncfusion.UI.Xaml.Editors">
<Grid>
<editors:SfAutoComplete x:Name="autoComplete"
Width="250"
PlaceholderText="Search social media..."
ItemsSource="{Binding SocialMedias}"
DisplayMemberPath="Name"
TextMemberPath="Name"
TextSearchMode="Contains" />
</Grid>
</Window>// Model
public class SocialMedia
{
public string Name { get; set; }
public int ID { get; set; }
}
// ViewModel
public class SocialMediaViewModel
{
public ObservableCollection<SocialMedia> SocialMedias { get; set; }
public SocialMediaViewModel()
{
SocialMedias = new ObservableCollection<SocialMedia>
{
new SocialMedia { Name = "Facebook", ID = 0 },
new SocialMedia { Name = "Instagram", ID = 1 },
new SocialMedia { Name = "Twitter", ID = 2 },
new SocialMedia { Name = "LinkedIn", ID = 3 }
};
}
}
// Set DataContext
autoComplete.DataContext = new SocialMediaViewModel();<editors:SfAutoComplete x:Name="autoComplete"
Width="300"
SelectionMode="Multiple"
PlaceholderText="Select multiple items..."
ItemsSource="{Binding SocialMedias}"
DisplayMemberPath="Name"
TextMemberPath="Name"
TextSearchMode="Contains" /><editors:SfAutoComplete ItemsSource="{Binding Countries}"
DisplayMemberPath="Name"
TextMemberPath="Name"
TextSearchMode="Contains"
PlaceholderText="Type to search..." /><editors:SfAutoComplete SelectionMode="Multiple"
ItemsSource="{Binding Tags}"
DisplayMemberPath="Name"
TextMemberPath="Name">
<editors:SfAutoComplete.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Padding="5">
<TextBlock Text="{Binding Name}"
FontWeight="SemiBold"/>
</StackPanel>
</DataTemplate>
</editors:SfAutoComplete.ItemTemplate>
</editors:SfAutoComplete><editors:SfAutoComplete ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
TextMemberPath="Name">
<editors:SfAutoComplete.LeadingView>
<Grid Padding="8">
<Path Data="M15.5 14h-.79l-.28-.27C15.41..."
Fill="{ThemeResource SystemAccentColor}"/>
</Grid>
</editors:SfAutoComplete.LeadingView>
</editors:SfAutoComplete><editors:SfAutoComplete ItemsSource="{Binding Products}"
DisplayMemberPath="Name"
TextMemberPath="Name"
NoResultsFoundContent="No products found. Try a different search." />| Property | Type | Description |
|---|---|---|
| | Collection of data items to display |
| | Property path for dropdown item display |
| | Property path for selection box text |
| | |
| | |
| | Watermark text when empty |
| | Currently selected item (single mode) |
| | Selected items collection (multiple mode) |
| | Content when no matches found |
| | Content displayed before text input |
| | Content displayed after text input |
| | Property path for grouping items |
| | Color for highlighting matched text |
| | Custom filtering logic |
ItemsSourceObservableCollectionSelectedItemSelectedItemsTextSearchMode.StartsWithPlaceholderTextAutomationProperties.Name| Issue | Solution |
|---|---|
| Suggestions not showing | Check |
| Wrong text displayed | Set |
| Filtering not working | Ensure |
| Multiple selection not working | Set |
| Custom template not applied | Check |
| No results message not showing | Set |