How to show/set Empty data

7 posts, 1 answers
  1. ALEX
    ALEX avatar
    61 posts
    Member since:
    Feb 2011

    Posted 24 Apr 2011 Link to this post

    Hi Expert,

                I follow this Combo Example. My problem is user don't key in field. When i show/reload a form, combox is always show first row. Actuall it should be show "Empty Message" in combo box. I search a forum, but i can't find it. :(.

               I set _raddlDelivery.SelectedIndex = -1; But also doesn't work. Kindly, please advice to me.


    Best Regards,
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Apr 2011 Link to this post

    Hello ALEX,

    In order to show empty message in combo box,  set AllowCustomText property of RadComboBox as true.

    ASPX:
    <telerik:RadComboBox ID="Combo" runat="server"  AllowCustomText="true"
    EmptyMessage="Choose a Product">

    Thanks,
    Princy.
  3. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 25 Apr 2011 Link to this post

    Hi ALEX,

    You could aslo set an empty message from the code behind. Please take a look at the following help article as it explains how this can be achieved: Using the EmptyMessage Property.

    Kind regards,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  4. ALEX
    ALEX avatar
    61 posts
    Member since:
    Feb 2011

    Posted 25 Apr 2011 Link to this post

    Hi Princy and Admin,

                 I follow your instruction. Stay does not work.

    Princy Method.
              I set
    <telerik:RadComboBox ID="Combo" runat="server"  AllowCustomText="true"
    EmptyMessage="Choose a Product">
               After that
    if (Convert.ToString(_order.Delivery) == null || Convert.ToString(_order.Delivery) == "")
                 _raddlDelivery.SelectedIndex = -1;//Does not work
                _raddlDelivery.SelectedValue = ""; //Does not work        
    else
                    _raddlDelivery.SelectedValue = Convert.ToString(_order.Delivery);
            If i selected "2W" record, after that i change another record without "Code", it show previous record.

    Admin method,

    if (Convert.ToString(_order.Delivery) == null || Convert.ToString(_order.Delivery) == "")
           _raddlDelivery.EmptyMessage = "Hello";
    else           
           _raddlDelivery.SelectedValue = Convert.ToString(_order.Delivery);
               If i selected 2W previous record, after that i change another record without "Code", it show previous record. But when i refresh page, it show "Hello". :(

               I need to set codebehind. I only bind one time, it also does not work. Kindly, please help to me.

    Best Regards,
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 27 Apr 2011 Link to this post

    Hello ALEX,

    I have attached a sample project demostrating a working Empty message for two RadComboBox controls - one binded to a sql datasource (using load on demand) and a second using an xml file. For the xml binded combobox, the empty message is set from code behind, however, you need to set AllowCustomText property as well, so the empty message is displayed.  I hope this is what you need. Please let me know how it goes.

    Regards,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. ALEX
    ALEX avatar
    61 posts
    Member since:
    Feb 2011

    Posted 28 Apr 2011 Link to this post

    Hi Team,


             Thanks for your reply. Specially, i want to clear or set empty "Choose something...", when my data is not found inside my combo. Now, I can solved by myself.

    Best Regards,
  7. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 28 Apr 2011 Link to this post

    Hi ALEX,

    I am happy that I could help you resolve the issue that you previously encountered. Let me know if you need further assistance.

    Greetings,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top