Setting the RadComboBoxItem.Template breaks RadComboBox.DisplayMemeberPath

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    4 posts
    Member since:
    Jun 2013

    Posted 29 Oct 2013 Link to this post

    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.
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 01 Nov 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top