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

RadComboBox EmptyMessage on page load

20 Answers 440 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 13 Apr 2009, 02:19 PM
Can someone please tell me how to enable the emptymessage to show in a radgridcombobox on page load?

I am binding the data from a datasource, and can not seem to get the "Please Select..." to show on page load.

I have tried setting the me.radcombobox1.selectedindex to -1 or .text =  me.radcombobox1.emptymessage in every place I could think of.

Any help would be greatly appreciated.

20 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 13 Apr 2009, 02:47 PM
Hello Philip,

The EmptyMessage property can be used when the AllowCustomText property is set to True.

More information is available in our help topic: Appearance and Styling > Using the EmptyMessage Property

Regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 18 Apr 2009, 11:41 AM
Hi Philip sorry to hijack your thread but I'm having the same issue....

No disrespect to the developers at Telerik as in the main it's a great product but this is a rubbish situation.

Looking back at the forums, it seems that for ages (years!) people have been asking to be able to have a drop down box that is initially showing a blank top item so it looks like this

---> 
       Value 1
       Value 2
       etc

Now the 'blank' row could have empty text - but you shouldn't have to enable the AllowCustomText property to do it.  Enabling that property is just plain stupid as it results in the user being able to put in any old rubbish and then find that the form fails validation... (given that the drop down will normally be bound to an INT in the database.

Hopefully I'm wrong and have just made a complete arse out of myself but if not please come up with a decent workaround.  Apologies in advance if I am wrong ;)

Also please put a full blown solution for this in the pipline for a future release (sooner the better).

Regards,

Jon
0
Atanas Korchev
Telerik team
answered on 20 Apr 2009, 10:21 AM
Hi Jon,

We usually recommend this approach when in need of "choose value" item in RadComboBox.
I have logged this as a feature suggestion (ShowEmptyText not to require AllowCustomText).

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 23 Apr 2009, 09:20 AM
Hi Albert,

Thanks for that - I'll have a look at this today now that I'm back on the programming.

That is a very good looking Panel, you should look at using some of the features in that for the round panel control that you'll be adding sometime in the future.  Especially if you can integrate the heading and heading image functionality into the one control!

Best Regards,

Jon
0
Servando
Top achievements
Rank 1
answered on 19 Jun 2009, 11:09 AM
I've just on the same problem, and I need also to unselect an item (usually it's done setting selectedIndex=-1). So I need to append  an "empty item"!!!

I've noted also that setting the selectedValue to an unexisting one there is no reaction from de RadComboBox (no error, no unselection...).
0
Veselin Vasilev
Telerik team
answered on 24 Jun 2009, 08:24 AM
Hello Servando,

There are two cases here:

1. ReadOnly mode - setting the SelectedIndex to -1 does not work because you should always have a selected item in this mode. This is how the standard DropDownList control works.

2. AllowCustomText is True - then the user can type anything in the combo input area. To clear the selection I suggest calling the ClearSelection() method of the combo and set its Text property to string.Empty.


Kind regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jason
Top achievements
Rank 2
answered on 28 Jan 2010, 05:21 AM
I just want to chime in and agree with the other Telerik users here that have the same problem I have. You should not have to mark AllowCustomText for the EmptyMessage to be available. Regardless of why it is like this, it should not be. Please fix in future version
0
Simon
Telerik team
answered on 28 Jan 2010, 02:27 PM
Hi Jason,

Thank you for your input.

We have this feature logged and will implement it in future versions of RadComboBox.

All the best,
Simon
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.
0
Stephen Braich
Top achievements
Rank 1
answered on 12 Feb 2010, 12:20 AM
I agree with the others.  Quite honestly this should be like the first feature any 3rd party combo box control should offer.  It is ridiculous that I should have to do a radcombo.Items.Add(new RadComboBoxItem("[Select Something]").  
0
Veselin Vasilev
Telerik team
answered on 16 Feb 2010, 10:42 AM
Hi guys,

We already added this as a feature request in our public issue tracking system. Please go vote for it here.

Greetings,
Veskoni
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
Vance Smith
Top achievements
Rank 1
answered on 07 Jun 2011, 12:09 AM
So is this feature availabe yet?
0
Simon
Telerik team
answered on 08 Jun 2011, 12:48 PM
Hi Vance,

Unfortunately the feature has not been implemented yet. We are working on some other additions (CheckBox support) and fixes to RadComboBox so it is coming after them.

Regards,
Simon
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
Jason
Top achievements
Rank 1
answered on 10 Jun 2011, 04:40 AM

It’s obvious that Telerik really only gives lip service to correcting this. Many of us have wanted this for years and it should be an easy fix. They just plain don’t care.....

0
Jon
Top achievements
Rank 1
answered on 14 Jun 2011, 01:41 PM
Hi Simon,

I'm just working on some issues with some old combo boxes of mine.  I've come across an issue whereby my validation fails because of having to use this awful work around and it's something that I'm sure that others have come across.

Basically because of the work around you have to provide extra validation on each and every combo box - not just the required fields.  The non-required combos need to be checked to ensure that they have a valid entry as opposed to some user typed in text.  Also the required combos need the same check - most of the time.

Come on, for the sake of a very simple addition to the combo box you'd save us all a lot of extra effort.  To make things simpler, create a new EmptyMessageString var or something to handle the new functionality so nothing breaks.

Please try and whip this in for the July update - it's a simple addition!!!  And if you can't include it in time PLEASE add it in the next incremental update.

Regards,

Jon
0
Simon
Telerik team
answered on 15 Jun 2011, 05:08 PM
Hi Jason, Jon,

The reason we were postponing this fix/feature was that we wanted to make other major refactoring of the whole 'empty message' idea and not simply change the way the message is rendered. Additionally this would take a considerable amount of time and that's why we couldn't fit it in our plans. 

Still both of you are right - we have been holding off this fix/feature for quite some time and it is indeed useful and even required in some setups. We will change our plans and implement just what the PITS items says for the next Q (Q2 2011).

Regards,
Simon
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
Jon
Top achievements
Rank 1
answered on 16 Jun 2011, 02:27 PM
Hi Simon,

Sounds great!  I look forward to seeing it.  I'd say that roughly half of the drop downs in my setup are cascading and they all require the empty message so this will be very well received!

Best Regards,

Jon
0
Cmdr. Beavis
Top achievements
Rank 1
answered on 07 Feb 2012, 06:13 PM
"2. AllowCustomText is True - then the user can type anything in the combo input area. To clear the selection I suggest calling the ClearSelection() method of the combo and set its Text property tostring.Empty."

Just wanted to say that the above worked perfectly for me.  Before I knew about 'EmptyMessage' et al, I was setting the Text property to a hard-coded string, which affected the control's behavior in a negative way.  (didn't highlight said text so that I could type in something new and have the existing/highlighted text go away.)

Thanks!
-Scott
0
Nicoleta
Top achievements
Rank 1
answered on 14 Aug 2012, 02:05 PM
Thank you Veselin, it works perfectly!
0
Ashish
Top achievements
Rank 1
answered on 07 Sep 2012, 02:59 PM

Hello Telerik Team,

I have used RadCombox in my site extensively, and also I have used the “EmptyMessage” property. Recently I have updated the Telerik version to “2012.2.724.35” and after that i am facing too many issues related to RadCombox.

Older Version we were using: 2011.1.519.35
New Version currently we are using: 2012.2.724.35

In Telerik “2012.2.724.35” version, i have used the following RadComboBox In my web page. Now the issue is, if I do not change the default selection of following ddlStatus i.e. the ddlStatus is set to “-Select One-” and when I trying to access the “SelectedItem” property of ddlStatus from code behind, then it gives a null value whereas with the previous telerik version (2011.1.519.35), if the ddlStatus is set to default selection i.e. “-Select One-” and if I trying to access the “SelectedItem” property of ddlStatus then it gives the object of 0th position item i.e. <telerik:RadComboBoxItem Text="" Value="0" />. Besides that, in “2012.2.724.35” version, for the default selection of ddlStatus, the ddlStatus.SelectedValue property gives the Empty string where as in older version(2011.1.519.35) it gives the value of 0th element i.e. "0".   

<telerik:RadComboBox ID="ddlStatus" runat="server" Width="60px" EmptyMessage="-Select one-">

       <Items>

              <telerik:RadComboBoxItem Text="" Value="0" />

              <telerik:RadComboBoxItem Text="No" Value="1" />

              <telerik:RadComboBoxItem Text="Yes" Value="2" />

       </Items>

</telerik:RadComboBox>

 

This changed behavior of RadComboBox encounters so many issues in my website. Is there any generic way to resolve this issue?

Please suggest the workaround to resolve this issue.

Thanks,
Ashish

 

0
Ivana
Telerik team
answered on 10 Sep 2012, 10:48 AM
Hello Ashish,

At its current state, RadComboBox does not require an extra item for its EmptyMessage functionality to work properly. In fact, setting the EmptyMessage property is sufficient.

Having in mind this major difference in the EmptyMessage functionality in both versions explains a lot on the matter why in the version of 2011 the RadComboBox property SelectedItem returns an actual item and in the version of 2012 the SelectedItem property of RadComboBox returns null.
The version of RadControls for ASP.NET AJAX of 2012 represents the correct behavior of the EmptyMessage functionality, whiles the older one seems more like a temporary workaround.

I understand this must have caused you a huge inconvenience, but I recommend to go trough your code and make the necessary changes so it applies the current setup of EmptyMessage functionality of RadComboBox.

I am really sorry for the inconvenience caused!

Regards,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Philip
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Jon
Top achievements
Rank 1
Atanas Korchev
Telerik team
Servando
Top achievements
Rank 1
Jason
Top achievements
Rank 2
Simon
Telerik team
Stephen Braich
Top achievements
Rank 1
Vance Smith
Top achievements
Rank 1
Jason
Top achievements
Rank 1
Cmdr. Beavis
Top achievements
Rank 1
Nicoleta
Top achievements
Rank 1
Ashish
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or