EmptyMessage not reseting after button click

5 posts, 1 answers
  1. Matt
    Matt avatar
    66 posts
    Member since:
    Apr 2009

    Posted 10 May 2010 Link to this post

    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



  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 13 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matt
    Matt avatar
    66 posts
    Member since:
    Apr 2009

    Posted 18 May 2010 Link to this post

    In that demo I don't see any postback situation.  Am I missing something?
  5. Answer
    Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 19 May 2010 Link to this post

    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.
  6. Matt
    Matt avatar
    66 posts
    Member since:
    Apr 2009

    Posted 24 May 2010 Link to this post

    Thanks so much, that worked!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017