Selecting first item in RadComboBox

8 posts, 0 answers
  1. Veshala
    Veshala avatar
    27 posts
    Member since:
    Aug 2009

    Posted 25 Jan 2011 Link to this post

    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.




  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 27 Jan 2011 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Veshala
    Veshala avatar
    27 posts
    Member since:
    Aug 2009

    Posted 27 Jan 2011 Link to this post

    Hi Stefan,

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

    Thanks

  5. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 02 Feb 2011 Link to this post

    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.
  6. brian
    brian avatar
    36 posts
    Member since:
    Jul 2010

    Posted 23 Nov 2012 Link to this post

    Actually, Combox box is the current control and DropDownList is not...   right?
  7. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 23 Nov 2012 Link to this post

    Hi Brian,

    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.

    Greetings,
    Nikolay
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  8. brian
    brian avatar
    36 posts
    Member since:
    Jul 2010

    Posted 23 Nov 2012 Link to this post

    Thanks.  I was looking for ASP.NET, was in wrong forum.   Why do the different suites have different controls?
  9. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 23 Nov 2012 Link to this post

    Hi Brian,

    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
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top
UI for WinForms is Visual Studio 2017 Ready