I upgraded my application from 2009.Q1 to 2010.Q3.
I have code to create RadComboBox dynamically and bind dataset to ComboBox and set to 'no selection' like this:
radComboBox.Text = null;
radComboBox.SelectedValue = null;
radComboBox.SelectedIndex = -1;
The code which was working in previous version is not working in new version. It is selecting first item in the list items.
I tried setting following ways also:
radComboBox.CloseDropDown();
radComboBox.Text = "Select Option";
&
radComboBox.CloseDropDown();
radComboBox.Text = " ";
In both the cases, it is selecting the first item.
So what changed in new version, that causes not to work.
Thanks for any help.
7 Answers, 1 is accepted
Thank you for writing.
As of Q2 2010 RadComboBox is an obsolete control and its successor is now called RadDropDownList. Since I am not sure which one exactly you use, I will provide you with code for accessing the BorderPrimitives of both controls:
//RadComboBox
radComboBox1.ComboBoxElement.ComboBoxBorder.ForeColor = Color.Red;
//RadDropDownList
BorderPrimitive radDropDownListBorderPrimitive = (BorderPrimitive)radDropDownList1.DropDownListElement.Children[2];
radDropDownListBorderPrimitive.ForeColor = Color.Tomato;
As to your question regarding removing the SelectedItem in RadComboBox, such functionality is not possible. For this reason, I will suggest that you upgrade your combo boxes to the new RadDropDownList. This will allow you to remove the SelectedItem by setting the SelectedIndex to -1.
I hope this information addresses your question. Let me know if you need further assistance.
Kind regards,
Stefan
the Telerik team
Hi Stefan,
I created support ticket to attach sample application to explain the problem.
Thanks
RadComboBox was obsoleted and removed from our suite a long time ago. The current combo control in our WinForms suite is RadDropDownList.
Let me know if you have additional questions.
Nikolay
the Telerik team
Due to a number of feature requests and necessary improvements for RadComboBox for WinForms, it was decided that we should introduce a brand new control with new and better architecture that would allow us to extend it the way our customer request. This also prevented our users from encountering breaking changes, which would have happened if all the changes had occurred in an existing control. RadComboBox was kept in the suite for more than an year after being obsoleted, which gave our users time to switch from it the improved implementation.
All the best,Nikolay
the Telerik team