This is a migrated thread and some comments may be shown as answers.

Setting the RadComboBoxItem.Template breaks RadComboBox.DisplayMemeberPath

1 Answer 74 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 29 Oct 2013, 10:36 PM
I already submitted a support ticket, but I just wanted to post here.

If the Template property of a RadComboBoxItem is set, then the DisplayMemberPath property of the RadComboBox will no longer display on each item in the drop down.  The currently selected item will still appear correctly.

The workaround is to explicitly set the ItemTemplate property on the RadComboBox.

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 01 Nov 2013, 09:46 AM
Hi Ryan,

As we have replied you in the support ticket for this particular scenario you need to replace the ContentPresenter inside DefaultRadComboBoxItemTemplate with:

<ContentPresenter x:Name="Content" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>

And DisplayMemberPath will work as expected. Or if you want to keep all the bindings inside and have it working correctly you can add the following line to the ContentPresenter setup:

ContentTemplateSelector="{TemplateBinding ContentControl.ContentTemplateSelector}"

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ComboBox
Asked by
Ryan
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or