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

RadComboBox not showing initial state via code

2 Answers 72 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ashvin
Top achievements
Rank 1
Ashvin asked on 23 Jul 2008, 08:22 AM
Hi Telerik Team,

I am stuck with one issue. I have a RadComboBox populated with some items stored on the DB. At a particular time on the screen when the user does a search. I need to set my RadComboBox back to their initial state (i.e.) Showing the first Item which is empty. This is being dont via code. C#

RadComboBox.SelectedIndex = 0;

But to my surprise the ComboBox still shows the last item selected on the screen even thought that the values it currently holds says that it is back to its initial state (When the page loads first time)
RadComboBox.SelectedValue  = "-1"
RadComboBox.SelectedItem.Text = "";

So technically there is not issue as it behaves as per the specs. But the end user will see a selected item on the RadComboBox which is not what needs to be seen.

Can you please help me on this one?

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosi
Telerik team
answered on 23 Jul 2008, 08:30 AM
Hi Ashvin,

I suggest you try the following code:

RadComboBox.ClearSelection();
RadComboBox.Text = "";


Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ashvin
Top achievements
Rank 1
answered on 23 Jul 2008, 08:37 AM
Thanks Rosi,

That just did the trick

Cheers
Ashvin
Tags
ComboBox
Asked by
Ashvin
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Ashvin
Top achievements
Rank 1
Share this question
or