Change DisplayMemberPath triggerd by IsDropDownOpen

2 posts, 1 answers
  1. Arnstein
    Arnstein avatar
    36 posts
    Member since:
    Oct 2012

    Posted 25 Apr 2014 Link to this post

    Hi, I'm trying to change the DisplayMemberPath triggered by IsDropDownOpen, but the displayed value does not change. I tried to change the background of the combobox just to verify that the trigger works, and the background is changed accordingly to the IsDropDownOpen state. Am I doing this wrong, do you have another solution?

                        <telerik:GridViewComboBoxColumn.EditorStyle>
                            <Style TargetType="telerik:RadComboBox">
                                <Style.Triggers>
                                    <Trigger Property="IsDropDownOpen" Value="False">
                                        <Setter Property="DisplayMemberPath" Value="Value1" />
                                        <Setter Property="Background" Value="Blue"/>
                                    </Trigger>
                                    <Trigger Property="IsDropDownOpen" Value="True">
                                        <Setter Property="DisplayMemberPath" Value="Value2" />
                                        <Setter Property="Background" Value="Yellow"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </telerik:GridViewComboBoxColumn.EditorStyle>

    Telerik version: 2013.3.1316.40

    Best regards
    Arnstein
  2. Answer
    George
    Admin
    George avatar
    1332 posts

    Posted 28 Apr 2014 Link to this post

    Hi Arnstein,

    Could you explain why it's needed to change the DisplayMemberPath property at runtime? I would suggest using the SelectionBoxTemplate property of RadComboBox to display a different information when item is selected. Please, refer to the attached project and let me know if this helps.

    Regards,
    George
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top