RadComboBox Clear with EmptyMessage

6 posts, 1 answers
  1. Keivan Kechmiri
    Keivan Kechmiri avatar
    10 posts
    Member since:
    Aug 2009

    Posted 06 Sep 2009 Link to this post

    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

     

     

  2. Yana
    Admin
    Yana avatar
    4847 posts

    Posted 07 Sep 2009 Link to this post

    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.
  3. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Sep 2009 Link to this post

    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
  4. Keivan Kechmiri
    Keivan Kechmiri avatar
    10 posts
    Member since:
    Aug 2009

    Posted 07 Sep 2009 Link to this post

    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
  5. Yana
    Admin
    Yana avatar
    4847 posts

    Posted 07 Sep 2009 Link to this post

    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.
  6. Krishna Chaitanya
    Krishna Chaitanya avatar
    1 posts
    Member since:
    Sep 2012

    Posted 04 Sep 2012 Link to this post

    Hi Yana,

    cboSearchGenre.Text = String.Empty; 
    cboSearchGenre.ClearSelection(); 
     is not working my side. Is anything else i need to do more ?
Back to Top