Hi!
I am trying to reload a radcombobox after a radwindow has closed using the onclientclose event.
I have pieced together this code from google searches. It seems to want to work but doesn't quite hit the mark.
My javascript:
My relevant aspx:
And finally my only bit of cs:
EDIT: I just enabled ENABLE LOADONDEMAND for the combobox but it did nothing.
When I put a breakpoint on my ajaxrequest in the code behind, it DOES fire and does the DataBind() without issue, so I know that all the javascript is working. However the control does not rebind unless I refresh the page, which I do not want to do.
I am trying to reload a radcombobox after a radwindow has closed using the onclientclose event.
I have pieced together this code from google searches. It seems to want to work but doesn't quite hit the mark.
My javascript:
<script type="text/javascript"> function UseRadWindow() { var oWnd = $find("<%= RadWindow1.ClientID %>"); oWnd.show(); oWnd.minimize(); oWnd.maximize(); oWnd.restore(); oWnd.OnclientClose = "OCC"; } function OCC() { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();}My relevant aspx:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" onajaxrequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rcbCustomer" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadWindowManager ID="RadWindowManager1" runat="server" style="z-index: 7001"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="addcust.aspx" Height="600px" Width="800px" Animation="Slide" OnClientClose="OCC"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> <telerik:RadComboBox ID="rcbCustomer" Runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="ID" Skin="Default" EmptyMessage="Select Customer..." Filter="Contains" BorderColor="LightSteelBlue" BorderStyle="Dashed" BorderWidth="2px" Width="150px"> <FooterTemplate> <telerik:RadButton ID="RadButton3" runat="server" OnClientClicked="UseRadWindow" Text="Add New..." AutoPostBack="False"> </telerik:RadButton> </FooterTemplate> </telerik:RadComboBox>And finally my only bit of cs:
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e){ //Bind the RadComboBod rcbCustomer.DataBind();}EDIT: I just enabled ENABLE LOADONDEMAND for the combobox but it did nothing.
When I put a breakpoint on my ajaxrequest in the code behind, it DOES fire and does the DataBind() without issue, so I know that all the javascript is working. However the control does not rebind unless I refresh the page, which I do not want to do.
