p.s.: I have already considered and discarded the use of a Control Template with the RadComboBox. I rather use the .NET Grid instead, since I will loose all the fancy features that made me choose Telerik's GridView in the first place.
Thanks in advance for any assistance that you may provide,
Julio
5 Answers, 1 is accepted
Indeed GridViewComboBoxColumn does not provide a SelectedItem property as the RadComboBox itself. May you provide a bit more information what is your particular scenario and why do you need such property in this column ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Hi Maya, maybe this is just a practice that needs to be revisited but when using MVVM pattern I must never code for the control. Therefore, to create a new entry on a GridView or on a editable ComboBox, I just initialize the SelectedItem. Please, bear in mind that Business rules (that force me to initialize the record while taking in consideration the context) and the MVVM design pattern prohibits the use of the features in controls that provides similar functionality. Please, your thoughts…
May you provide a bit more information about your scenario and your specific settings and requirements ? Based on the information provided, I am not quite capable of grasping the basic idea.
Generally, following MVVM Patter does not contradict with the fact that the GridViewComboBoxColumn does not have a SelectedItem property.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Just to confirm my reasoning: If I need to select a different item in the combobox from my ViewModel all I need is to set the SelectedValue property? If I have a misconception, please provide me with a code sample that navigates the combobox from a VM (no code behing and no coding for control's specific features).
Thanks for your assistance,
Basically, the purpose of the RadComboBox (which is the editor of the GridViewComboBoxColumn) is to edit look up values for the underlying data object of the RadGridView, not to get the items of the combo box itself. The idea is to set a property for this item and trough this specific column to bind it to the values in another source. If you want to set a particular property, you can work with the items of the grid and set their properties. As it is in our online documentation, you may set the CountryID property of the Person object.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>