I'm trying to work out why my code isn't working with the "control_name.EmptyMessage = message" type command from server side code. It works when running in the initial page load but then on ajax calls it doesn't set the fields.
Also in Javascript the set_emptyMessage command doesn't seem to work on a similar basis...Interestingly I can use the set_text command to acheive the same goal.
Is there a known bug with the emptymessage commands or will I need to post some code?
Regards,
Jon
12 Answers, 1 is accepted
We haven't such a known bug with the EmptyMessage property of RadComboBox. Could you please send us a sample which demonstrates the issue to examine it locally?
Sincerely yours,
Helen
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.

Short of posting the whole page code on the forum (which I'd prefer not to do) is there an email address that I can send the code to?
Regards,
Jon
I'd suggest you open a formal support ticket and send us a simple running project (incl. your custom skin, CSS, images, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.
Thanks,
Paul
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.

I'll post some relevant bits of the code here as I don't have the time to rebuild the page in a simpler format :(
It now looks as though this issue affects the SelectedValue field as well as EmptyMessage so I suppose that it is something quite basic and will affect more fields in the control. The really odd thing is that the data in the control gets populated just fine but anything else doesn't work.
Essentially I've got multiple cascading drop downs and they are all setup using your methods posted on this site.
In the following code the LoadClients is triggered from the PageLoad event and using a ClientID value from the DataBound event I can get that to select the existing value and if necessary set the emptyMessage. LoadClients calls LoadComboBox to do the database load.
The part that fails is the LoadContacts, it is called in javascript on the PageLoad event. It is called with the selected ContactID value and debugging the code I can see the value going into the LoadComboBox sub. Once the page loads, all of the values are in the drop down but there is no selected value.... Very weird.
It's all very fustrating as the effort to get cascading drop downs working is pretty immense. This is the last hurdle for me now.
Protected Sub LoadComboBox(ByVal comboBoxControl As String, ByVal idField As String, ByVal textField As String, ByVal unselectedMessage As String, ByVal sqlString As String, Optional ByVal selectedValue As String = "", Optional ByVal storedProcedure As Boolean = False, Optional ByVal parameterArray() As String = Nothing, Optional ByVal valueArray() As String = Nothing) |
Dim sqlConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString) |
Dim sqlDataAdapter As New SqlDataAdapter(sqlString, sqlConnection) |
If storedProcedure Then sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure |
If parameterArray IsNot Nothing AndAlso valueArray IsNot Nothing AndAlso parameterArray.Length() = valueArray.Length() Then |
For i As Integer = 0 To UBound(parameterArray) |
sqlDataAdapter.SelectCommand.Parameters.AddWithValue(parameterArray(i), valueArray(i)) |
Next |
End If |
Dim dataTable As New DataTable() |
sqlDataAdapter.Fill(dataTable) |
Dim uxRadComboBox As RadComboBox = DirectCast(uxFormView.FindControl(comboBoxControl), RadComboBox) |
uxRadComboBox.DataTextField = textField |
uxRadComboBox.DataValueField = idField |
uxRadComboBox.DataSource = dataTable |
uxRadComboBox.DataBind() |
If selectedValue <> "" Then uxRadComboBox.SelectedValue = selectedValue |
If unselectedMessage <> "" Then uxRadComboBox.EmptyMessage = unselectedMessage |
End Sub |
Protected Sub LoadClients() |
LoadComboBox("uxClient", "ClientID", "Name", "", "usp_CRUD_CLI_ClientsSelectByContactPermissions", _clientID, True, New String() {"@contactID"}, New String() {Session.Item("ContactID").ToString()}) |
End Sub |
Protected Sub LoadContacts(ByVal dataID As String) |
Dim valueArray() As String = dataID.Split(","c) |
Dim selectedValue As String = "" |
If valueArray.Length = 2 Then selectedValue = valueArray(1) |
LoadComboBox("uxContact", "ContactID", "ContactName", " - Select a Contact - ", "usp_CRUD_CON_ContactsSelectByClient", selectedValue, True, New String() {"@ClientID"}, New String() {valueArray(0)}) |
End Sub |
Thanks in advance for any help!
Regards,
Jon
PS. It's worth noting that this post below is similar although it seems to indicate that a fix was due (I have the most recent version - 2009.1.402.35)
http://www.telerik.com/community/forums/aspnet-ajax/combobox/combobox-and-emptymessage.aspx

We tried to reproduce the problem at our samples, but without much success. Please find attached our test files for details. Is it possible to modify them so we to be able to see the exact problem locally?
Regards,
Helen
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.

They work fine! Typical.
I suspect that the problem revolves around me having to use the DirectCast as the control is within a formview and hence the code behind can't see the control except via a search (Dim uxRadComboBox As RadComboBox = DirectCast(uxFormView.FindControl(comboBoxControl), RadComboBox))
I'm stuffed for time now so can't play with the code much for now.
Your example did show me one thing that has given me a good work around. I was assuming that because of the load triggering a child load that I couldn't put the children into the PageLoad. In your example you did that and it worked. As such I've had a stab and it works fine for me. I suppose that it's in the name isn't it - onclientselectedindexchanging? Client - not server.
Given that the controls are now populated in the initial server page load, the font problem has also disappeared! I wonder if the problem stems from the fact that the child controls don't get setup properly when the page loads initially (no databinding done on them).
The following is the Contact drop down box that is affected by the problem:
<telerik:RadComboBox ID="uxContact" Runat="server" EmptyMessage=" - Select a Client - " AllowCustomText="true" CssClass="fullWidthTextBox" |
onitemsrequested="uxContact_ItemsRequested" |
OnClientItemsRequested="DropDownLoaded"> |
</telerik:RadComboBox> |
If I get time over the next few weeks I'll try and look into it some more.
Thanks for the assistance,
Regards
Jon

I found a similar issue when using client-side api to change the empty message.
After some trying I found that the method of set_emptyMessage by itself will not update the empty message of radcombobox, but if you call clearSelection method on client-side, then the new empty message will show for the radcombobox.
I am using Q3 2015 version. May be a Telerik support professional can confirm this.
combo2.set_emptyMessage(
"Select a deleted Product to Recover"
);
combo2.clearSelection();
//this line is needed for new empty message to show up

Could you please open a support ticket and send us your complete code, which will help us to understand the problem better?
Regards,
Helen
Telerik

Hi Helen,
You are right.
Actually in my scenario, I had 2 RadComboxes with checkboxes, and when I transfered checked items on client-side from one to another, I did not uncheck these items when adding tto the second RadComboBox. By calling clearSelection, it seems the items added to second RadComboBox got unchecked which then displayed the empty message. If I did not call clearSelection method on second RadComboBox, then it showed an empty text and also no empty message.
Thanks
Sunil
As I already mentioned below we are not sure about the exact your scenario. This particular solution works for your case, but it is not necessary in general.
Please send us a sample project which demonstrates the issue to investigate it locally.
Regards,
Helen
Telerik