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

RadCombobox not displaying the SelectedValue after closing and opening the application

3 Answers 659 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 03 Nov 2017, 11:47 AM

Hi,

I have binded custom object collection to the RaCombobox selecting an item and saving is working fine but displaying the item again once we close and open the application is not working.

 

                    <telerik:RadComboBox Name="AppContextNames" Width="150" Height="25" SelectedItem="{Binding AppContext,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding Path=DataContext.SharedActionVM.AppContextCollection,RelativeSource={RelativeSource AncestorType={x:Type telerik:RadTreeListView}}}" DisplayMemberPath="Name" />

Here while setting it is working fine but again if go to that combobox  even the AppContext object contains value it is showing empty combo value but combocollection is present.

Is there something I have to do from my side??

Regards,

Nagasree.

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 08 Nov 2017, 10:13 AM
Hi Dharmavaram,

Thank you for contacting us.

Using only the provided code snippet I am not exactly sure what is the set-up in your main application. How you have saved and load the combo box? You can elaborate more on your scenario. It will be great if you can send me isolated project from your application reproducing this behavior so I can directly investigate it on my side. This way I could have better look at your set up.

I have created a sample project to test your scenario which used our PersistenceFramework to save and load the control. The project is attached to this reply. When you run the project select different item from the combo box and pressed the save button. Then close the application and run it again. You can observe that the last selected item is loaded correctly. 

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Mahesh
Top achievements
Rank 1
answered on 02 Dec 2019, 10:13 AM

Hi,

I'm also facing similar issue, I've a RadComboBox inside the RadGridView. When loading the tab very first time data inside the combobox is not displaying. We have data in selectedvalue and in itemsource collection, but it is not displaying. Combobox is in editable mode.

<telerik:RadComboBox x:Name="ComboBox" Tag="{Binding SeqNo,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextSearchStyle}" 
           ItemsSource="{Binding DataContext.List, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}}"
                SelectedValue="{Binding Code, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="Code"  IsEditable="True" ItemTemplate="{StaticResource ComboBoxItem}" ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
                CanKeyboardNavigationSelectItems="True" TextSearchMode="Contains" IsFilteringEnabled="True"  OpenDropDownOnFocus="False" GotFocus="ComboBox_GotFocus" LostFocus="ComboBox_LostFocus" DropDownClosed="ComboBox_DropDownClosed"  GotKeyboardFocus="ComboBox_GotKeyboardFocus"
                IsTextSearchEnabled="True" KeyDown="ComboBox_KeyDown" PreviewKeyDown="ComboBox_KeyUp" CanAutocompleteSelectItems="False" TabIndex="7" >
                                                    <telerik:RadComboBox.ToolTip>
                                                        <StackPanel Height="Auto" Width="Auto" MaxWidth="300" Background="#F2F2F2">
                                                            <TextBlock Text="{Binding ShortDescription}" Style="{StaticResource ToolTipCodesDescriptionTextBlock}"/>
                                                        </StackPanel>
                                                    </telerik:RadComboBox.ToolTip>
                                                    <i:Interaction.Triggers>
                                                        <i:EventTrigger EventName="GotFocus">
                                                            <i:InvokeCommandAction Command="{Binding DataContext.LoadPopUpCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}}" CommandParameter="{Binding DataContext, ElementName=ComboBox}" />
                                                        </i:EventTrigger>
                                                        <i:EventTrigger EventName="DropDownClosed">
                                                            <i:InvokeCommandAction Command="{Binding DataContext.CPTSelectionChanged, RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}}" 
                CommandParameter="{Binding DataContext, ElementName=CPTComboBox}"/>
                                                        </i:EventTrigger>
                                                        <i:EventTrigger EventName="LostFocus">
                                                            <i:InvokeCommandAction Command="{Binding DataContext.ComboLostFocusCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}}" CommandParameter="{Binding DataContext, ElementName=ComboBox}" />
                                                        </i:EventTrigger>
                                                    </i:Interaction.Triggers>
                                                </telerik:RadComboBox>

Regards,

Mahesh

0
Dinko | Tech Support Engineer
Telerik team
answered on 05 Dec 2019, 09:01 AM

Hi Mahesh,

Thank you for the provided code snippet.

To avoid any misunderstanding, can you share the RadGridView and its set-up. This way, I can try to mimic your implementation and try to reproduce this behavior.

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ComboBox
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Mahesh
Top achievements
Rank 1
Share this question
or