I have following code
when I clicked something form combobox and have error and return value to old value in that case the selected item in combobox is the last selected
01.
public
class
MyClass
02.
{
03.
public
int
ForeignId
04.
{
05.
get
06.
{
07.
return
MyObject.ForeignId;
08.
}
09.
10.
set
11.
{
12.
int
oldValue = MyObject.ForeignId;
13.
14.
try
15.
{
16.
MyObject.No = Helper.Help(value)
17.
}
18.
catch
19.
{
20.
MyObject.ForeignId = oldValue;
21.
}
22.
23.
OnPropertyChanged(() => ForeignId);
24.
}
25.
}
26.
27.
public
MyObject MyObject{
get
;
set;
}
28.
}
<
telerik:RadComboBox
ItemsSource
=
"{Binding ItemList}"
DisplayMemberPath
=
"Name"
SelectedValuePath
=
"ForeignId"
SelectedValue
=
"{Binding ForeignId, Mode=TwoWay, ValidatesOnDataErrors=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}"
/>