I'm in the process of upgrading the previous RadComboBox from 2009 to the newest version and I encountered a weird behaviour with the new RadDropDownList. ( note: this also affects RadComboBox in the newest version)
I did a simple test by binding the controls to a strongly typed datatable, setting the valuemembers and display members and then set the default value to 1 of the items that exist in that table. -
Listed below are code snippets from the old RadComboBox (2009) and the new RadDropDownList.
2009 version of the code which works. - The end result of this is that when the combobox is loaded, the default selected value is Australia. If I just refactored the code by changing this RadComboBox to a RadDropDownList and try to Debug it right after the box.SelectedValue = "Au"; shows that the selectedValue is still null.
RadComboBox box =
box.DataSource = [StronglyTypedCountryDataTable]
// this table contains columns code, name
After upgrading to the new 2011 version, the above mentioned code doesnt work any more. when the control is loaded, it always displays the 1st item in the box ("Afghanistan") even when the selected value has been set to Au. I tried changing the datasource to a List, DataView and the same behaviour exists.
Finally, I tried adding the items manually and it worked...
2011 version -
RadDropDownList list =
list.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
Country country = Country.Get();
Can someone explain to me why the 1st method of implementation doesnt work the same as the 2nd method?