Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > RadComboBox don't shows selected item

Not answered RadComboBox don't shows selected item

Feed from this thread
  • Posted on Jul 2, 2010 (permalink)

    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

    Reply

  • Justin avatar

    Posted on Feb 24, 2011 (permalink)

    I'm having this same problem.

    Reply

  • Posted on Feb 27, 2011 (permalink)

    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

    Reply

  • Justin avatar

    Posted on Feb 28, 2011 (permalink)

    Yes, I am using the RadComboBox.

    Reply

  • Posted on Mar 1, 2011 (permalink)

    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

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Mar 2, 2011 (permalink)

    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!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > RadComboBox don't shows selected item
Related resources for "RadComboBox don't shows selected item"

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