Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > Selecting first item in RadComboBox

Not answered Selecting first item in RadComboBox

Feed from this thread
  • Veshala avatar

    Posted on Jan 25, 2011 (permalink)

    Hi,

    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.




    Reply

  • Stefan Stefan admin's avatar

    Posted on Jan 27, 2011 (permalink)

    Hello Vanitha,

    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
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Veshala avatar

    Posted on Jan 27, 2011 (permalink)

    Hi Stefan,

    I created support ticket to attach sample application to explain the problem.

    Thanks

    Reply

  • Stefan Stefan admin's avatar

    Posted on Feb 2, 2011 (permalink)

    Hi Veshala,

    Thank you for the clarification. Let me know if you need anything else.

    All the best,
    Stefan
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > Selecting first item in RadComboBox
Related resources for "Selecting first item in RadComboBox"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]