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

How to show/set Empty data

6 Answers 190 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 24 Apr 2011, 08:30 AM
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,

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Apr 2011, 08:26 AM
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.
0
Kate
Telerik team
answered on 25 Apr 2011, 09:48 AM
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.

0
ALEX
Top achievements
Rank 1
answered on 25 Apr 2011, 10:55 AM
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,
0
Kate
Telerik team
answered on 27 Apr 2011, 11:12 AM
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.

0
ALEX
Top achievements
Rank 1
answered on 28 Apr 2011, 09:35 AM
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,
0
Accepted
Kate
Telerik team
answered on 28 Apr 2011, 04:13 PM
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.

Tags
ComboBox
Asked by
ALEX
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kate
Telerik team
ALEX
Top achievements
Rank 1
Share this question
or