or
I have a user control with an AjaxManagerProxy on it, a RadComboBox, a button, and a RadWindow. Users click the button to open the RadWindow to add an item to the RadComboBox. After they click save, the record is inserted into the database, the window is closed and a javascript method is executed to "rebind" the combobox. Unfortunately the combobox items are not updated, however, if I click the button to add another item and just close the window the list is updated. If I click the button and add another button, the item I previously added appears in the list but not the current one.
Here is some code from the user control.
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnNewDepartment"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rdoDepartment" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManagerProxy> <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server"> <Windows> <telerik:RadWindow ID="NewDepartmentDialog" runat="server" Width="500px" Left="150px" Height="425px" Behaviors="Close" Title="New Department Details" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" OnClientClose="OnDepartmentWindowClose" /> </Windows> </telerik:RadWindowManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="20"> <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /> </telerik:RadAjaxLoadingPanel>
<telerik:RadComboBox ID="rdoDepartment" runat="server" width="300px" DataTextField="DepartmentName" DataValueField="DepartmentCode" MarkFirstMatch="true" /><asp:TextBox ID="txtEmployeeDepartmentRegularlyWorked" runat="server" MaxLength="50" Width="150px" /><telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript" language="javascript"> function ShowInsertForm() { window.radopen("Window.aspx", "NewDepartmentDialog"); return false; } function OnDepartmentWindowClose(sender, args) { $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("rebindDepartment"); } </script> </telerik:RadCodeBlock>Protected Sub manager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Select Case e.Argument Case "rebindDepartment" Me.rdoDepartment.Items.Clear() Me.rdoDepartment.DataSource = db.SPs.CompanyDepartmentListSelect(Utility.GetCompanyKey).GetDataSet Me.rdoDepartment.DataBind() Me.rdoDepartment.Items.Insert(0, New RadComboBoxItem("", "")) End SelectEnd SubProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page) AddHandler manager.AjaxRequest, AddressOf manager_AjaxRequest
End Sub
//map to appointment objectsforeach (DataRow row in events.Tables[0].Rows){ DateTime startDate = (DateTime)row["Event_StartDate"]; DateTime endDate = (DateTime)row["Event_EndDate"]; if (startDate <= endDate) { AppointmentData apt = new AppointmentData(); apt.Start = startDate; apt.End = endDate; //apt.Attributes.Add("ProgramName", row["ProgramName"].ToString()); apt.Description = row["ProgramName"].ToString(); apt.Subject = "<b>" + row["Event_Title"].ToString() + "</b><br><i>" + row["ProgramName"].ToString() + "</i>"; //apt.Description = row["Event_Description"].ToString(); apt.ID = row["EventId"].ToString(); if (!addedAppts.Contains(apt.ID.ToString())) { appts.Add(apt); addedAppts.Add(apt.ID.ToString()); } }}<%@ Control Language="VB" AutoEventWireup="false" CodeFile="gridEntitiesAndCCs.ascx.vb" Inherits="gridEntitiesAndCCs" %> <link href="CTM.css" rel="stylesheet" type="text/css" /> <telerik:RadGrid ID="gridEntitiesAndCCs" runat="server" AllowSorting="True" AllowMultiRowSelection="true" AutoGenerateColumns="False" GridLines="None"> <MasterTableView DataKeyNames="EntityID,CostCtr" AllowMultiColumnSorting="true"> <Columns> <telerik:GridClientSelectColumn UniqueName="clientSelect" > <ItemStyle Width="25" /> </telerik:GridClientSelectColumn> <telerik:GridBoundColumn DataField="ShortName" HeaderText="Entity" SortExpression="ShortName" UniqueName="ShortName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CostCtr" HeaderText="Cost Center" SortExpression="CostCtr" UniqueName="CostCtr"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DeptName" HeaderText="Dept Name" SortExpression="DeptName" UniqueName="DeptName"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> <Selecting AllowRowSelect="true" /> </ClientSettings> </telerik:RadGrid>Partial Class gridEntitiesAndCCs Inherits System.Web.UI.UserControl Public ReadOnly Property selectedValues() As String Get Return Me.getCheckedRowDetails() End Get End Property Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub gridEntitiesAndCCs_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridEntitiesAndCCs.NeedDataSource Dim ds As DataSet = MM.getUserEntitiesAndCostCenters() gridEntitiesAndCCs.DataSource = ds End Sub Private Function getCheckedRowDetails() As String Dim row As GridItem Dim entityID As String Dim costCtr As String Dim dstCCs As New DataSet Dim dtblCCs As DataTable = New DataTable("EntsCCs") dstCCs.Tables.Add(dtblCCs) dtblCCs.Columns.Add(New DataColumn("entityID", GetType(String))) dtblCCs.Columns.Add(New DataColumn("costCtr", GetType(String))) Dim drowItem As DataRow For Each row In gridEntitiesAndCCs.SelectedItems entityID = row.OwnerTableView.DataKeyValues(row.ItemIndex)("EntityID") costCtr = row.OwnerTableView.DataKeyValues(row.ItemIndex)("CostCtr") drowItem = dtblCCs.NewRow() drowItem("entityID") = entityID drowItem("costCtr") = costCtr dtblCCs.Rows.Add(drowItem) Next Return dstCCs.GetXml() End Function End Class 
Private Sub rgDefects_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgDefects.ItemDataBound 'don't process anything other than data rows If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then With DirectCast(e.Item, Telerik.Web.UI.GridDataItem) 'set the UOM_Text based upon the UM based upon the UM .Item("UM").Text = Measure.DisplayUoM(UnitType.Linear, UserAccount.UnitSystemPreference) End With End IfEnd Sub