This is a migrated thread and some comments may be shown as answers.

RadComboBox don't shows selected item

7 Answers 208 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martin Horst
Top achievements
Rank 1
Martin Horst asked on 02 Jul 2010, 08:47 AM

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

7 Answers, 1 is accepted

Sort by
0
Justin
Top achievements
Rank 1
answered on 24 Feb 2011, 10:54 PM
I'm having this same problem.
0
Emanuel Varga
Top achievements
Rank 1
answered on 27 Feb 2011, 10:07 AM
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
0
Justin
Top achievements
Rank 1
answered on 28 Feb 2011, 04:10 PM
Yes, I am using the RadComboBox.
0
Emanuel Varga
Top achievements
Rank 1
answered on 01 Mar 2011, 01:31 PM
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
0
Ivan Todorov
Telerik team
answered on 02 Mar 2011, 10:34 AM
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!
0
Matthew
Top achievements
Rank 1
answered on 12 Jun 2012, 04:16 PM
Hi Martin,

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

regards,
Matthew 
0
Ivan Todorov
Telerik team
answered on 14 Jun 2012, 03:36 PM
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 >>
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Martin Horst
Top achievements
Rank 1
Answers by
Justin
Top achievements
Rank 1
Emanuel Varga
Top achievements
Rank 1
Ivan Todorov
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or