WPF telerik:RadComboBox set SelectedItem not working

1 Answer 756 Views
ComboBox
JC
Top achievements
Rank 1
JC asked on 16 Nov 2021, 12:09 AM | edited on 16 Nov 2021, 12:10 AM

Hi All,
I'm trying the different ways to Set the SelectedItem to WPF telerik:RadComboBox after load the data and this is still showing  the default option empty.
I'm loading the data from my ViewModel (MVVM). Any ideas?

<telerik:RadComboBox x:Name="ActionList" DisplayMemberPath="Name" Grid.Column="1" Grid.Row="0" ItemsSource="{Binding ActionList, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedAction, Mode=TwoWay}" IsEditable="True" IsReadOnly="True" telerik:TextSearch.TextPath="Name" MinWidth="120" />

View Model:
private ActionModel _selectedAction;

public AtionModel SelectedAction

{

get { return _selectedAction; }

set { _selectedAction = value; NotifyOfPropertyChange(() => SelectedAction); }

}

 


1 Answer, 1 is accepted

Sort by
1
Accepted
Stenly
Telerik team
answered on 18 Nov 2021, 04:22 PM

Hello Jose Carlos,

I have created a sample project, using the provided code snippet, and this behavior was only present when the property, that is bound to the SelectedItem property, was not set to a specific value from the ActionList collection. After setting the SelectedAction property to an item from the mentioned collection, the item became visible as soon as the application was loaded. However, if this approach was already tested and it was not working correctly on your end, could you modify the attached project, so that this behavior is also present in it?

Regards,
Stenly
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ComboBox
Asked by
JC
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or