SfComboBox MaximumSuggestion property not working in .NET MAUI
Subject: SfComboBox MaximumSuggestion property not working in .NET MAUI
Hello Syncfusion Support Team,
I'm experiencing an issue with the MaximumSuggestion property in the SfComboBox control in my .NET MAUI application. The property doesn't appear to limit the number of suggestions displayed in the dropdown as expected.
Issue Description
- Setting
MaximumSuggestionto a value (e.g., 3) in my custom SfComboBox class doesn't limit the dropdown items - The dropdown continues to show all items from the ItemsSource regardless of the MaximumSuggestion value
Code Sample
Here's a simplified version of my custom CfComboBox implementation:
public class CSfComboBox : SfComboBox { public CSfComboBox() { IsClearButtonVisible = false; ShowSuggestionsOnFocus = true; DropDownButtonSettings.Width = 20; DropDownBackground = Colors.White; DropDownPlacement = DropDownPlacement.Auto; MaximumSuggestion = 3; } }later in the code protected override View SetContentView() { // Other code omitted for brevity... combobox.ShowBorder = false; combobox.DropDownItemFontSize = FFont.FontSizeContent; combobox.FontSize = FFont.FontSizeContent; combobox.FontFamily = FFont.FontFamilyContent; combobox.DropDownItemHeight = 50; combobox.DropDownButtonSettings.Width = 0; combobox.MaxDropDownHeight = 0; combobox.DisplayMemberPath = CItem.ItemID; // combobox.MaximumSuggestion = 2; // Also tried setting it here, but still no effect // Later in the code, we handle dropdown display like this: // In DropDownUpdate method: private void DropDownUpdate() { if (combobox.IsDropDownOpen) combobox.IsDropDownOpen = false; combobox.MaxDropDownHeight = entry.Text.Length >= FilterCharacter ? Suggestion.Count > 4 ? DropDownHeight : (int)combobox.DropDownItemHeight * Suggestion.Count : 0; if (combobox.MaxDropDownHeight > 0) combobox.IsDropDownOpen = true; } // And we set suggestions like this: private void DataSourceChanged(object sender, EventArgs e) { CData result = null; var suggestion = new ObservableCollection<CItem>(); lookup.DataSource.ForEach(x => { if (x[TargetName].ClearString().TrimStart() == entry.Text.ClearString().TrimStart()) result = x; suggestion.Add(new CItem(x[TargetName], x[Reference[0]])); }); if (FSetting.IsAndroid) combobox.SelectedItem = string.Empty; Suggestion = suggestion; IsValidValue = !IsModifier || string.IsNullOrWhiteSpace(entry.Text) || (entry.Text.ClearString() == Value.I.ClearString() && IsValidValue) || result != null; } // The Suggestion property is bound to the ItemsSource of the combobox // combobox.SetBinding(S
When using this control, all suggestions are still displayed, not limited to 3 as specified.
Hi @Nguyen Thinh ,
Thank you for reaching out to us. We are currently validating the reported query. We will get back to you with the details by April 22nd, 2025. We appreciate your patience in the meantime.
Regards,
Priyadharshni M
Hi Nguyen Thinh,
We have logged the bug for the reported issue "SfComboBox MaximumSuggestion Property Not Respected When Dropdown Opened Programmatically in .NET MAUI". This fix will be included in the upcoming weekly release on May 06, 2025.
Link: 67148
Note: The provided feedback link is private, and you need to log in to view this feedback.
If you have any more specifications or scenarios to be tested, you can add them as a comment in the portal.
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and work reprioritization.”
Regards,
Kamalesh P
Hi Nguyen,
We have included a fix for the reported issue "SfComboBox MaximumSuggestion Property Not Respected When Dropdown Opened Programmatically in .NET MAUI" in our latest weekly NuGet release, v29.1.41, which is now available for download (NuGet).
Please get in touch with us if you require any further assistance; as always, we would be happy to help you.
Regards,
Kamalesh P
- 3 Replies
- 3 Participants
-
NT Nguyen Thinh
- Apr 17, 2025 04:48 AM UTC
- May 6, 2025 12:52 PM UTC