An exception occurred when ComboBoxAdv enabled AutoCompleteMode="Suggest"

I use ComboBoxAdv in the Treeview control template and set AutoCompleteMode="Suggest" to filter. When there are multiple rows of data in the list, entering values in a certain row of ComboBoxAdv to filter will cause the current options of other rows of ComboBoxAdv to be cleared


Attachment: Img__facd16af_69a2d247.zip

3 Replies

BA BagavathiPerumal Apranandham Syncfusion Team March 13, 2023 02:39 PM UTC

Hi Wpfdev1 Kunyi,


Each combo box should have unique item sources. If you want to map to the same ItemsSource, you can create a converter that gives a new CollectionViewSource for each ItemsSource binding. Please refer to the below code snippets for your reference.

Code snippets:

<Window.Resources>
<local:CustomViewConverter x:Key="customViewConverter"/>
</Window.Resources>

ItemsSource="{Binding States, Converter={StaticResource customViewConverter}}"

public class CustomViewConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return new CollectionViewSource { Source = value }.View;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
We have attached a sample for your reference. Please let us know if you need any further assistance.

Regards,
Bagavathi Perumal A

Attachment: ComBoBoxAdvAutoComplete_3360af97.zip


EH Ella Helga March 12, 2025 04:40 AM UTC

To address the issue of ComboBoxAdv clearing options in other rows when filtering, consider implementing a custom filtering function. This function can manage the Melon Playground  filtering logic independently for each row, ensuring that the state of one ComboBox does not affect others.Additionally, you might explore using data binding to maintain separate data contexts for each ComboBoxAdv instance. This way, each ComboBox can retain its options while filtering based on user input without interference from other rows.



NS Nithi Sneha Samuel Jeba Kumar Syncfusion Team March 12, 2025 09:50 AM UTC

Hi Wpfdev1 Kunyi,

We have validated your query, and found that the issue occurs because all instances of ComboBoxAdv are bound to the same collection .When a filter is applied in one row, it modifies the shared collection, affecting all other ComboBoxAdv instances.To resolve this, we recommend ensuring that each row maintains an independent filtered collection without duplicating the data unnecessarily.


A modified sample has  been attached for your reference.


If we misunderstood the requirement, please provide an update on the requirement. It will help us prompt the solution earlier.


Regards,
Nithi Sneha S


Attachment: ComboBoxadvSample_bcb5e0b5.zip

Loader.
Up arrow icon