RadComboBox don't shows selected item

8 posts, 0 answers
  1. Martin Horst
    Martin Horst avatar
    39 posts
    Member since:
    Apr 2010

    Posted 02 Jul 2010 Link to this post

    Update: Ignore this post or close it. The problem was not the RadComboBox itself.

    Best regards

    Martin

    Hi,

    I've a RadComboBox inside a UserControl with the DropDropStyle=DropDownList. I added three elements and after that I selected the third one:

      radComboBoxItems.Add(new RadComboBoxItem("1", 1));
    radComboBox.Items.Add(new RadComboBoxItem("2", 2));
    radComboBox.Items.Add(new RadComboBoxItem("3", 3));
    radComboBoxSelectedValue = 3;

    I also tried:

      radComboBoxSelectedIndex = 2;

    In both ways the the SelectedIndex is correct and when the ListBox appears the correct item is selected. But the ComboBox itself doesn't display the selected item. The funny thing is, that the same code works fine on a Windows Form. So, what's the problem there.

    Regards

    Martin

  2. Justin
    Justin avatar
    2 posts
    Member since:
    Feb 2011

    Posted 24 Feb 2011 Link to this post

    I'm having this same problem.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 27 Feb 2011 Link to this post

    Hello guys,

    Justin are you using the RadComboBox or the RadDropDownList?
    Are you using a data source for the control or items?

    Please answer these questions and i will help you find a solution.

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
  5. Justin
    Justin avatar
    2 posts
    Member since:
    Feb 2011

    Posted 28 Feb 2011 Link to this post

    Yes, I am using the RadComboBox.
  6. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 01 Mar 2011 Link to this post

    Hello again Justin,

    Sorry, I could not replicate this issue.

    Please try the following and let me know if this is working for you:
    using System;
    using System.Windows.Forms;
    using Telerik.WinControls.UI;
     
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            var userControl = new SomeUserControl();
            this.Controls.Add(userControl);
            userControl.Dock = DockStyle.Fill;
        }
    }
     
    public class SomeUserControl : UserControl
    {
        private RadComboBox radComboBox;
     
        public SomeUserControl()
        {
            this.Controls.Add(radComboBox = new RadComboBox());
            radComboBox.Items.Add(new RadComboBoxItem("1", 1));
            radComboBox.Items.Add(new RadComboBoxItem("2", 2));
            radComboBox.Items.Add(new RadComboBoxItem("3", 3));
        }
     
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            radComboBox.SelectedValue = 3;
        }
    }

    Or what are you doing differently.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
    Telerik WinForms MVP
  7. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 02 Mar 2011 Link to this post

    Hi Justin,

    I was not able to replicate this issue as well. Please try Emanuel's suggestion and let us know if it worked for you. If it did not, then please provide us with more details about your case - a code snippet or a sample project. The version of the controls you are using might also be important.

    I am looking forward to hearing from you.

    Best wishes,
    Ivan Todorov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  8. Matthew
    Matthew avatar
    1 posts
    Member since:
    Nov 2010

    Posted 12 Jun 2012 Link to this post

    Hi Martin,

    Could you explain what the problem actually was?
    I am having the exact same problem.

    regards,
    Matthew 
  9. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 14 Jun 2012 Link to this post

    Hello Matthew,

    Thank you for writing.

    As you can notice, the issue in this thread has not yet been identified. Therefore, if you experience any issues, you can open a new support ticket or a forum thread and describe the issue in detail. This will let us investigate it and provide you with proper support.

    Additionally, if you are contacting us via a support ticket, you can attach a sample project which demonstrates the issue. This will help us in isolating the issue and provide you with a quicker response.

    I am looking forward to hearing from you.

    Greetings,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready