3 Answers, 1 is accepted
0
Accepted
Hello Austin,
The currently selected item in a regular case should be reflected in the bound property of your business object.
For example if you have a combo field for choosing countries e.g. bound to the CountryID property of your business object ( DataMemberBinding = {Binding CountryID} ), then you can read the property( CountryID) itself.
In case you have more complicated scenario , please give some more details so we can think of some solution .
All the best,
Pavel Pavlov
the Telerik team
The currently selected item in a regular case should be reflected in the bound property of your business object.
For example if you have a combo field for choosing countries e.g. bound to the CountryID property of your business object ( DataMemberBinding = {Binding CountryID} ), then you can read the property( CountryID) itself.
In case you have more complicated scenario , please give some more details so we can think of some solution .
All the best,
Pavel Pavlov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
0

Austin
Top achievements
Rank 1
answered on 24 Aug 2011, 09:47 PM
This certainly helped me, but I have another related issue.
If I take the DataMemberBinding value (In your example CountryID, which is also the DataFormComboBoxField's SelectedValuePath) and change it, I expect to see the ComboBox change it's selection. This is what occurs when I edit the bound value through the DataForm, and all is good - but if I manually change the CountryID value through the code behind, I see no changes in the DataForm on either the ComboBox or the CountryID field. Naively I attempted to DataForm.UpdateLayout, but I'm obviously missing something here, as no matter what I seem to do in the code behind I can't get the DataForm to recognize the new CountryID value.
Any suggestions?
Edit: I've corrected this issue myself through INotifyPropertyChanged
If I take the DataMemberBinding value (In your example CountryID, which is also the DataFormComboBoxField's SelectedValuePath) and change it, I expect to see the ComboBox change it's selection. This is what occurs when I edit the bound value through the DataForm, and all is good - but if I manually change the CountryID value through the code behind, I see no changes in the DataForm on either the ComboBox or the CountryID field. Naively I attempted to DataForm.UpdateLayout, but I'm obviously missing something here, as no matter what I seem to do in the code behind I can't get the DataForm to recognize the new CountryID value.
Any suggestions?
Edit: I've corrected this issue myself through INotifyPropertyChanged
0
Hello Austin,
Glad to know you have solved the issues.Yes , indeed the INotifyPropertyChanged is the recommended way.
All the best,
Pavel Pavlov
the Telerik team
Glad to know you have solved the issues.Yes , indeed the INotifyPropertyChanged is the recommended way.
All the best,
Pavel Pavlov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>