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

EmptyMessage not reseting after button click

4 Answers 101 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 10 May 2010, 05:42 PM
The EmptyMessage shows up fine on initial page load.  I'm setting AllowCustomText="True" and Filter="Contains".  I can select a value and submit it.  But on page postback the selected item shows up in the combobox instead of the EmptyMessage text.

Help!  Thanks.

Here's a link to the example: RadComboBox bug



4 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 13 May 2010, 01:13 PM
Hello Matt,

Here's a sample demo for filtering and EmptyMessage. As you can see the EmptyMessage appears again after postback.

If this doesn't help, please send me the full code you are using so we can inspect it and help you.

Thank you!

All the best,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Matt
Top achievements
Rank 1
answered on 18 May 2010, 08:36 PM
In that demo I don't see any postback situation.  Am I missing something?
0
Accepted
Veronica
Telerik team
answered on 19 May 2010, 10:13 AM
Hi Matt,

To be able to show the EmptyMessage two conditions must be satisfied:

1. No item is selected;
2. RadComboBox is blurred;

So when you select an item and commit a postback, the selected item still remains. To be able to show the EmptyMessage after postback you'll need to clear the selection of an item and cause the RadComboBox to loose it's focus (blur).

Here is the code to do this:

protected void Button1_Click(object sender, EventArgs e)
    {
        RadComboBox1.ClearSelection();
        RadComboBox1.Text = string.Empty;
    }

Find the full code in the attached .zip file.

All the best,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Matt
Top achievements
Rank 1
answered on 24 May 2010, 10:48 PM
Thanks so much, that worked!
Tags
ComboBox
Asked by
Matt
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Matt
Top achievements
Rank 1
Share this question
or