Hello,
I have an application with several pages that contain RadComboBoxes. When I select an option in the first RadComboBox it triggers the other RadComboBoxes to load options based on that selection. Or rather, it used to do this. This application has been working this way for years after having been developed in Visual Studio 2008 targeting the 3.5 .NET framework. Recently, I tried upgrading this application to the 4.0 .NET framework so I could develop in Visual Studio 2010. Now the RadComboBoxes will not be updated properly when the 1st one's selected option is changed.
Here is the first combobox:
The important attribute here is OnClientSelectedIndexChanging. It triggers javascript code that should cause other RadComboBoxes to be populated with data. The javascript looks like this:
Here is what the second combobox looks like:
The function in the code-behind, ebaParticipant_ItemsRequested, triggered by the OnItemsRequested event sets up a couple of parameters for ObjectDataSource used by the RadComboBox then calls "ebaParticipant.DataBind()" to fill this second combobox with data based on the selected option in the first combobox.
While debugging in VS2010 I can step through the code and see that the SelectMethod defined for the ObjectDataSource is being called and I can see the data returned from its database query. The correct data is being returned. And here is where something breaks down. For some reason the second combobox on the web page is no longer being filled with the returned data. Can anyone suggest a way to debug this step in the process? Any ideas what's going wrong? Does it have something to do with the change from .NET 3.5 to 4.0? I'm using version 2011.1.519.35 of Telerik.Web.UI.dll.
-- Tom
I have an application with several pages that contain RadComboBoxes. When I select an option in the first RadComboBox it triggers the other RadComboBoxes to load options based on that selection. Or rather, it used to do this. This application has been working this way for years after having been developed in Visual Studio 2008 targeting the 3.5 .NET framework. Recently, I tried upgrading this application to the 4.0 .NET framework so I could develop in Visual Studio 2010. Now the RadComboBoxes will not be updated properly when the 1st one's selected option is changed.
Here is the first combobox:
<
telerik:radcombobox
id
=
"ebaCountry"
runat
=
"server"
DataTextField
=
"Text"
DataValueField
=
"Value"
MarkFirstMatch
=
"True"
AllowCustomText
=
"False"
OnClientSelectedIndexChanging
=
"LoadCountryDependentCombos"
OnItemsRequested
=
"ebaCountry_ItemsRequested"
OnClientSelectedIndexChanged
=
"EbaChangeCountry"
OnClientBlur
=
"EbaChangeCountry"
OnClientLoad
=
"SetCountryClientId"
></
telerik:radcombobox
>
The important attribute here is OnClientSelectedIndexChanging. It triggers javascript code that should cause other RadComboBoxes to be populated with data. The javascript looks like this:
var item = eventArqs.get_item();
ebaParticipant.set_text(" Loading...");
ebaParticipant.requestItems(item.get_value(), false);
Here is what the second combobox looks like:
<
telerik:RadComboBox
runat
=
"server"
ID
=
"ebaParticipant"
MarkFirstMatch
=
"true"
DataSourceID
=
"objdsParticipant"
OnClientItemsRequested
=
"ItemsLoaded"
AllowCustomText
=
"False"
OnClientSelectedIndexChanged
=
"EbaChangeParticipant"
OnClientBlur
=
"EbaChangeParticipant"
OnItemDataBound
=
"ebaParticipant_ItemDataBound"
OnClientLoad
=
"SetParticipantClientId"
OnItemsRequested
=
"ebaParticipant_ItemsRequested"
>
<
ItemTemplate
>
<
ul
>
<
li
style
=
"float: left; width: 110px; margin: 0; padding: 0 5px 0 0; line-height: 14px"
>
<%# DataBinder.Eval(Container.DataItem, "PersonName") %></
li
>
<
li
style
=
"float: left; width: 110px; margin: 0; padding: 0 5px 0 0; line-height: 14px"
>
<%# DataBinder.Eval(Container.DataItem, "MinistryName") %></
li
>
</
ul
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
The function in the code-behind, ebaParticipant_ItemsRequested, triggered by the OnItemsRequested event sets up a couple of parameters for ObjectDataSource used by the RadComboBox then calls "ebaParticipant.DataBind()" to fill this second combobox with data based on the selected option in the first combobox.
While debugging in VS2010 I can step through the code and see that the SelectMethod defined for the ObjectDataSource is being called and I can see the data returned from its database query. The correct data is being returned. And here is where something breaks down. For some reason the second combobox on the web page is no longer being filled with the returned data. Can anyone suggest a way to debug this step in the process? Any ideas what's going wrong? Does it have something to do with the change from .NET 3.5 to 4.0? I'm using version 2011.1.519.35 of Telerik.Web.UI.dll.
-- Tom