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

Change DisplayMemberPath triggerd by IsDropDownOpen

1 Answer 180 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Arnstein
Top achievements
Rank 1
Arnstein asked on 25 Apr 2014, 08:10 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 28 Apr 2014, 12:35 PM
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.
 
Tags
ComboBox
Asked by
Arnstein
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or