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

RadComboBox Clear with EmptyMessage

5 Answers 515 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Keivan Kechmiri
Top achievements
Rank 1
Keivan Kechmiri asked on 06 Sep 2009, 06:07 PM

Hi

I have a RadComboBox with a EmptyMessage and want to clear the content, I've tried:

cboSearchGenre.Text = null;
cboSearchGenre.clearSelection();
and
cboSearchGenre.Text = "";
cboSearchGenre.clearSelection();
and
cboSearchGenre.set_text(cboSearchGenre.get_emptyMessage());
cboSearchGenre.clearSelection();

But I always get a empty ComboBox without the EmptyMessage or in the last example I get a ComboBox with the EmptyMessage as Text content not empty, how can I clear the CombBox and get the EmptyMessage from Client Side?

/Keivan

 

 

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 Sep 2009, 12:35 PM
Hi Keivan ,

Please try it like this:

cboSearchGenre.Text = String.Empty; 
cboSearchGenre.ClearSelection(); 

It works at our side without a problem.

Greetings,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Sep 2009, 12:57 PM
Hi Keivan,

I hope you are trying to set the EmptyMessage of the Combo on the client side along with clearing the ComboBox selection. If so try the following approach and see it is working.

JS:
 
 cboSearchGenre.clearSelection(); 
 cboSearchGenre.set_emptyMessage(cboSearchGenre.get_emptyMessage()); 

Regards
Princy
0
Keivan Kechmiri
Top achievements
Rank 1
answered on 07 Sep 2009, 02:24 PM
Hi

The second approach works:
cboSearchGenre.clearSelection();
cboSearchGenre.set_emptyMessage(cboSearchGenre.get_emptyMessage());

Is this the correct way, the first approach doesn't work, the ComboBox is empty without EmptyMessage, is this by design or a bug?

/Keivan
0
Yana
Telerik team
answered on 07 Sep 2009, 02:26 PM
Hi Keivan,

Actually my suggestion was server-side, but obviously you needed client-side approach. I'm sorry for the confusion.

Kind regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Krishna Chaitanya
Top achievements
Rank 1
answered on 04 Sep 2012, 07:44 AM
Hi Yana,

cboSearchGenre.Text = String.Empty; 
cboSearchGenre.ClearSelection(); 
 is not working my side. Is anything else i need to do more ?
Tags
ComboBox
Asked by
Keivan Kechmiri
Top achievements
Rank 1
Answers by
Yana
Telerik team
Princy
Top achievements
Rank 2
Keivan Kechmiri
Top achievements
Rank 1
Krishna Chaitanya
Top achievements
Rank 1
Share this question
or