DisplayMemberPath when using a custom ItemTemplate defaults to .ToString() of the bound object

Hi,

I especially oriented myself at this part of the documentation.

On my side it looks like this:

<syncfusion:ComboBoxAdv Grid.Row="0"
                                        Margin="10"
                                        AutoCompleteMode="Suggest"
                                        ItemsSource="{Binding Inspection.RollerDefects}"
                                        SelectedItem="{Binding SelectedDefect}"
                                        AllowMultiSelect="False"
                                        IsEditable="True">
                    <syncfusion:ComboBoxAdv.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Id, StringFormat={}Defekt Nr.: {0}}" />
                        </DataTemplate>
                    </syncfusion:ComboBoxAdv.ItemTemplate>
                </syncfusion:ComboBoxAdv>

The ItemSelector looks correct, but when I select an item, the currently selected item display text is being set to the selected objects .ToString() output. When I tell the control to use a DisplayMemberPath alongside to a custom ItemTemplate, i get a runtime error that its not allowed to use DisplayMemberPath whilst using a custom ItemTemplate. What can I do?


Also, searching for text also does not really work well, it uses the .ToString() to find keywords i enter in the box but when i search for actual numbers it doenst find anything, because the number does not appear in the objects .ToString()

hHMsuttfvD.png


1 Reply

KS Koppolu Sai Sivani Koppolu Ragaiah Syncfusion Team October 15, 2025 01:30 PM UTC

Hi Johannes,

The ComboBoxAdv does not support the simultaneous use of DisplayMemberPath and a custom ItemTemplate. This restriction also impacts its integrated search feature, which depends on DisplayMemberPath for text matching.

To ensure consistent display formatting, we’ve overridden the .ToString() method in the underlying data model to return a formatted string that aligns with the visual structure defined in the ItemTemplate, and to enable search functionality, a custom approach has been implemented by managing the ComboBoxAdv_KeyUp event. The default view of the ItemsSource is obtained through CollectionViewSource.GetDefaultView, and a filter is applied according to the user’s input.

Please refer to the attached sample for implementation details. Let us know if you have any questions or need further assistance—we’re happy to help.

Regards,

K Sai Sivani


Attachment: ComboBoxAdv_Sample_(2)_50e54313.zip

Loader.
Up arrow icon