This could just be my ignorance on how the RadAjaxManager/client-side action works, but I'm having a problem getting the Combo Box selected value to change in a specific scenario using the RadAjaxManager.
In this demo, I'm just trying to set the third combo to whatever index the second one is set to. This is not a desired production action, just a way to test whether the index is actually changing or not. In all cases, the third combo includes more than the number of items in the second combo.
Using this code, the third combo box refreshes correctly, but I'm having the whole page refresh each time, as a result of the AutoPostBack's:
Default4.aspx.vb
Default4.aspx
Everything works great, the cboInterventionTools_SelectedIndexChanged() routine runs, and the cboInterventionDurations.SelectedIndex gets changed correctly.
If I add RadAjaxManager functionality, so that the screen doesn't refresh, the routine runs, but the combo control does not refresh:
Code added to Default4.aspx:
(right after the ScriptManager)
The idea is that any change to "Areas of Concern" automatically refreshes the "Intervention Tool", client-side.
I need to be able to change the "Intervention Duration" to reflect a specific default duration time per tool. It needs to make a call to SQL to determine that information. If I embed that code into the cboInterventionTools_SelectedIndexChanged() routine, it all runs, and it even SETS the index correctly... but the control never changes visually on the screen.
Is there something I need to do to trigger that combo refresh, client-side, once the routine has completed?
In this demo, I'm just trying to set the third combo to whatever index the second one is set to. This is not a desired production action, just a way to test whether the index is actually changing or not. In all cases, the third combo includes more than the number of items in the second combo.
Using this code, the third combo box refreshes correctly, but I'm having the whole page refresh each time, as a result of the AutoPostBack's:
Default4.aspx.vb
Partial Class Default4 Inherits System.Web.UI.Page Protected Sub cboInterventionTools_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles cboInterventionTools.SelectedIndexChanged cboInterventionDurations.SelectedIndex = cboInterventionTools.SelectedIndex End Sub End Class Default4.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default4.aspx.vb" Inherits="Default4" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <asp:Panel ID="pnlMain" runat="server"> Areas of Concern<br /> <asp:SqlDataSource ID="sqlAreasOfConcern" runat="server" ConnectionString="<%$ ConnectionStrings:RTIDesktop %>" SelectCommand="AreasOfConcern_List" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter DefaultValue="1" Name="ContentAreaID" /> </SelectParameters> </asp:SqlDataSource> <telerik:RadComboBox AutoPostBack="true" Height="300px" Width="200px" runat="server" ID="cboAreasOfConcern" DataSourceID="sqlAreasOfConcern" DataTextField="AreaOfConcernName" DataValueField="AreaOfConcernID" ExpandDelay="0"> </telerik:RadComboBox> <br /> Intervention Tool<br /> <asp:SqlDataSource ID="sqlInterventionTools" runat="server" ConnectionString="<%$ ConnectionStrings:RTIDesktop %>" SelectCommand="InterventionTools_List" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter DefaultValue="28172" Name="PersonID" /> <asp:ControlParameter ControlID="cboAreasOfConcern" Name="AreaOfConcernID" PropertyName="SelectedValue" /> <asp:Parameter DefaultValue="8" Name="GradeLevelID" /> <asp:Parameter DefaultValue="1" Name="DummyParameter" /> </SelectParameters> </asp:SqlDataSource> <telerik:RadComboBox AutoPostBack="true" Height="300px" Width="200px" runat="server" ID="cboInterventionTools" DataSourceID="sqlInterventionTools" DataTextField="InterventionToolName" DataValueField="InterventionToolID" ExpandDelay="0"> </telerik:RadComboBox> <br /> Intervention Duration<br /> <asp:SqlDataSource ID="sqlInterventionDurations" runat="server" ConnectionString="<%$ ConnectionStrings:RTIDesktop %>" SelectCommand="InterventionDurations_List" SelectCommandType="StoredProcedure"> </asp:SqlDataSource> <telerik:RadComboBox Height="300px" Width="200px" runat="server" ID="cboInterventionDurations" DataSourceID="sqlInterventionDurations" DataTextField="InterventionDurationName" DataValueField="InterventionDurationID" ExpandDelay="0"> </telerik:RadComboBox> <br /> </asp:Panel> </div> </form> </body> </html> Everything works great, the cboInterventionTools_SelectedIndexChanged() routine runs, and the cboInterventionDurations.SelectedIndex gets changed correctly.
If I add RadAjaxManager functionality, so that the screen doesn't refresh, the routine runs, but the combo control does not refresh:
Code added to Default4.aspx:
(right after the ScriptManager)
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="cboAreasOfConcern"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="cboInterventionTools" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> The idea is that any change to "Areas of Concern" automatically refreshes the "Intervention Tool", client-side.
I need to be able to change the "Intervention Duration" to reflect a specific default duration time per tool. It needs to make a call to SQL to determine that information. If I embed that code into the cboInterventionTools_SelectedIndexChanged() routine, it all runs, and it even SETS the index correctly... but the control never changes visually on the screen.
Is there something I need to do to trigger that combo refresh, client-side, once the routine has completed?