It is possible to restore selected value in the view model i'm trying
something like this but combobox do not changed to the correct item you see last selected from the use
<telerik:RadComboBox ItemsSource="{Binding Tests}" Width="150" Height="25"
SelectedValuePath="Id">
<telerik:RadComboBox.SelectedValue>
<Binding Path="SelectedTestId" Mode="TwoWay" BindsDirectlyToSource="True" UpdateSourceTrigger="PropertyChanged"/>
</telerik:RadComboBox.SelectedValue>
<telerik:RadComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</telerik:RadComboBox.ItemTemplate>
</telerik:RadComboBox>
public int SelectedTestId
{
get
{
return selectedTestId;
}
set
{
OldSelectionTestId = selectedTestId;
SetProperty(ref selectedTestId, value);
if (OldSelectionTestId > 20 && SelectedTestId == 20)
{
Debug.WriteLine($"oldSelectionTestId = {OldSelectionTestId}");
Debug.WriteLine($"SelectedTestId = {SelectedTestId}");
HasError = true;
}
}
}