Hi,
I have a ASPX page with Rad grid , this grid loaded with data.
when a row is selected and clicked on a radTolBarButton,to edit its content . Actually it opens a Rad window (window.radopen) with all the controls in editable mode.
we can edit and save , also have a facility to close this window ( provided a Rad button 'Close' in a Rad tool bar )
My Requirement is below.
on edit - save - close button click
1.Need to close the window - (this is happening)
2.Need to refresh the content in the grid - from - where this rad window opend. (this is not happening)
I dont want to change Content edit procedure. This is already finalised.
The only thing is to refresh the grid content on Rad window close.
Please help me.
Thanks in advance
<asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div> <div id="divSchedular" runat="server"> <div style="width: 810px; background: transparent url('Images/background.png') no-repeat 0 0; padding-left: 20px;"> <telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Web20" CustomAttributeNames="DisplayStartTime, EventColor, DisplayEndTime, StartDate,EndDate,DisplayPermitName,DisplayFacilityVisibility,DisplayClientVisibility,DisplayResourceVisibility,Id,DisplayPermitVisibility,DisplayFacilityname,DisplayResourceName,DisplayClientName" DataStartField="StartDate" EnableDatePicker="true" GroupingDirection="Horizontal" EnableEmbeddedSkins="true" DataDescriptionField="EventColor" MonthView-GroupingDirection="Horizontal" DataEndField="EndDate" ShowFullTime="true" DataKeyField="Id" FirstDayOfWeek="Sunday" LastDayOfWeek="Saturday" DataSubjectField="DisplayPermitName" AllowDelete="false" AllowEdit="false" TimelineView-NumberOfSlots="7" AllowInsert="false" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"> <AdvancedForm Modal="true" /> <%--daystarttime="08:00:00" dayendtime="23:00:00"--%> <AppointmentTemplate> <div> <table> <tr> <td id="divColorChange" runat="server" width="0.5%"> <div> <%--CommandArgument='<%# Eval("Id") + "~" + Eval("EventColor") %>'--%> </div> </td> <td> <%--CustomAttributeNames="StartTime,EndTime,SessionDate,DisplayPermitName,StartDate,DisplayClientVisibility,DisplayResourceVisibility,DisplayFacilityVisibility,EndDate,ID,DisplayPermitVisibility,DisplayFacilityName,DisplayResourceName,DisplayClientName,Event_ID,DisplayRoomNumber"--%> <div class="AlignCenter"> <%--Permit Name--%> <asp:LinkButton runat="server" ID="lblDisplayPermitName" OnClick="RedirectToEventMaintenance" Style="font-weight: bold; color: Black; word-wrap: break-word; font-size: 12px;" Visible='<%# Convert.ToBoolean(Eval("DisplayPermitVisibility")) %>' CommandArgument='<%# Eval("Id") + "~" + Eval("StartDate")%>'> <%# Eval("DisplayPermitName")%> </asp:LinkButton> <asp:Label ID="labelPermitName" Style="font-weight: normal; color: Black; word-wrap: break-word; font-size: 10px;" runat="server" Text='<%# Eval("DisplayPermitName")%>' CssClass="FontBold"></asp:Label> <br /> <%--Start Time--%> <%--End Time--%> <asp:Label runat="server" ID="lblStartTime" Style="font-weight: normal; word-wrap: break-word; color: Black; font-size: 10px; text-align: left; float: left;"> <%# Eval("DisplayStartTime")%></asp:Label> - <asp:Label runat="server" ID="lblEndTime" Style="font-weight: normal; word-wrap: break-word; color: Black; font-size: 10px; text-align: left; float: left;"> <%# Eval("DisplayEndTime")%></asp:Label> <br /> <%--Client Name--%> <asp:Label runat="server" ID="lblDisplayClientTypeName" Style="font-weight: normal; word-wrap: break-word; color: Black; font-size: 10px; width: 95px; text-align: left; float: left;" Visible='<%# Convert.ToBoolean(Eval("DisplayClientVisibility")) %>'> <%# Eval("DisplayClientName")%> </asp:Label><br /> <%--Text="<left>Client :</left>"--%> <%--Facility Name--%> <asp:Label runat="server" ID="lblDisplayFacilityName" Style="font-weight: normal; color: Black; font-size: 10px; word-wrap: break-word; width: 95px; float: left; float: left; text-align: left; float: left;" Visible='<%# Convert.ToBoolean(Eval("DisplayFacilityVisibility")) %>'> <%# Eval("DisplayFacilityname")%> </asp:Label><%--Text="<left>Facility :</left>"--%> <br /> <%--Resource Name--%> <asp:Label runat="server" ID="lblDisplayResourceName" Style="font-weight: normal; color: Black; font-size: 10px; word-wrap: break-word; width: 95px; text-align: left; float: left;" Visible='<%# Convert.ToBoolean(Eval("DisplayResourceVisibility")) %>'> <%# Eval("DisplayResourceName")%> </asp:Label><br /> <%--Text="<left>Resource :</left>" --%> <%--Resource Name--%> <asp:Label runat="server" ID="Label2" Style="font-weight: normal; width: 95px; color: Black; font-size: 10px; text-align: left; word-wrap: break-word; float: left;"><%-- Text="<left>Room :</left>"--%> <%# Eval("DisplayResourceName")%> </asp:Label><br /> <br /> <asp:LinkButton ID="linkButtonMore" Style="font-weight: bold; width: 95px; color: Black; font-size: 10px;" runat="server" Text="More"></asp:LinkButton> </div> </td> </tr> </table> </div> </AppointmentTemplate> </telerik:RadScheduler> </div> <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="420" Height="300" ToolTipZoneID="RadScheduler1" Animation="Resize" HideEvent="LeaveToolTip" Text="Loading..." RelativeTo="Mouse" OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" OnClientBeforeShow="clientBeforeShow"> </telerik:RadToolTipManager> </div> <div class="ClearBoth"> </div> </div> </ContentTemplate> </asp:UpdatePanel> <div id="divCalendar" runat="server" visible="false"> <telerik:RadCalendar ID="RadCalendar1" runat="server" Font-Names="Arial,Verdana,Tahoma" OnSelectionChanged="RadCalendar1_SelectionChanged" AutoPostBack="true" ForeColor="Black" Skin="Web20" MultiViewColumns="4" MultiViewRows="3" PresentationType="Preview" UseColumnHeadersAsSelectors="false" UseRowHeadersAsSelectors="false" ShowOtherMonthsDays="False"> </telerik:RadCalendar> </div>RadCalendar1.SelectedDates.Clear(); RadCalendar1.SpecialDays.Clear(); RadCalendarDay NewDay = new RadCalendarDay(RadCalendar1); this.EventController.State.Events = EventCollection; if (this.EventController.State.Events.Count > 0) { foreach (Event eventObj in this.EventController.State.Events) { NewDay.Date = DateTime.Parse(eventObj.StartDate.ToString()); NewDay.IsSelectable = true; NewDay.ItemStyle.CssClass = "specialDay"; NewDay.ToolTip = eventObj.Permit.PermitName; NewDay.ItemStyle.BackColor = System.Drawing.Color.Aqua; NewDay.ItemStyle.BorderColor = System.Drawing.Color.Blue; RadCalendar1.SelectedDates.Add(new RadDate(Convert.ToDateTime(eventObj.StartDate.ToString()))); RadCalendar1.SpecialDays.Add(NewDay); } }Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Dim windowManager As New RadWindowManager()
Dim window1 As New RadWindow()
If e.CommandName = "Select" Then
Dim selectedRow As GridDataItem = DirectCast(e.Item, GridDataItem)
Session("custid") = selectedRow.GetDataKeyValue("custid")
window1.Width = "800"
window1.Height = "520"
window1.VisibleTitlebar = "false"
window1.VisibleStatusbar = "false"
window1.NavigateUrl = "~/custinfo.aspx?custid=" & Session("custid").ToString
window1.ID = "RadWindow1"
window1.VisibleOnPageLoad = True
window1.ReloadOnShow = "true"
' Set this property to True for showing window from code
RadWindowManager1.Windows.Add(window1)
'Page.Form.Controls.Add(widnow1)
End Sub
<telerik:RadGrid AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AutoGenerateEditColumn="true" DataSourceID="FirstDataSource" Height="380" ID="FirstGrid" OnDeleteCommand="Grid_OnCommand" OnInsertCommand="Grid_OnCommand" OnItemDeleted="Grid_OnItemDeleted" OnItemInserted="Grid_OnItemInserted" OnItemUpdated="Grid_OnItemUpdated" OnUpdateCommand="Grid_OnCommand" runat="server"> <MasterTableView DataKeyNames="Id"> <Columns> <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="System Id" ReadOnly="True" UniqueName="FirstId"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" ConfirmText="Delete this record?\n\nThis action cannot be undone." Text="Delete" UniqueName="DeleteFirst"> </telerik:GridButtonColumn> </Columns> </MasterTableView> <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"> <Selecting AllowRowSelect="true" /> <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" /> </ClientSettings> </telerik:RadGrid> <telerik:RadGrid AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AutoGenerateEditColumn="true" DataSourceID="SecondDataSource" Height="380" ID="SecondGrid" OnDeleteCommand="Grid_OnCommand" OnInsertCommand="Grid_OnCommand" OnItemDeleted="Grid_OnItemDeleted" OnItemInserted="Grid_OnItemInserted" OnItemUpdated="Grid_OnItemUpdated" OnUpdateCommand="Grid_OnCommand" runat="server"> <MasterTableView DataKeyNames="Id"> <Columns> <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="System Id" ReadOnly="True" UniqueName="SecondId"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FirstId" DataType="System.Int32" ForceExtractValue="Always" ReadOnly="True" UniqueName="FirstId" Visible="false"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" ConfirmText="Delete this record?\n\nThis action cannot be undone." Text="Delete" UniqueName="DeleteSecond"> </telerik:GridButtonColumn> </Columns> </MasterTableView> <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"> <Selecting AllowRowSelect="true" /> <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" /> </ClientSettings> </telerik:RadGrid> <telerik:RadGrid AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AutoGenerateEditColumn="true" DataSourceID="ThirdDataSource" Height="380" ID="ThirdGrid" OnDeleteCommand="Grid_OnCommand" OnInsertCommand="Grid_OnCommand" OnItemDeleted="Grid_OnItemDeleted" OnItemInserted="Grid_OnItemInserted" OnItemUpdated="Grid_OnItemUpdated" OnUpdateCommand="Grid_OnCommand" runat="server"> <MasterTableView DataKeyNames="Id"> <Columns> <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="System Id" ReadOnly="True" UniqueName="ThirdId"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SecondId" DataType="System.Int32" ForceExtractValue="Always" ReadOnly="True" UniqueName="SecondId" Visible="false"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" ConfirmText="Delete this record?\n\nThis action cannot be undone." Text="Delete" UniqueName="DeleteThird"> </telerik:GridButtonColumn> </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" /> </ClientSettings> </telerik:RadGrid> </telerik:RadPane> </telerik:RadSplitter> <asp:EntityDataSource ConnectionString="name=Entities" DefaultContainerName="Entities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Firsts" EntityTypeFilter="First" ID="FirstDataSource" runat="server"> </asp:EntityDataSource> <asp:EntityDataSource ConnectionString="name=Entities" DefaultContainerName="Entities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Seconds" EntityTypeFilter="Second" ID="SecondDataSource" runat="server" Where="it.[FirstId] = @FirstId"> <WhereParameters> <asp:ControlParameter ControlID="FirstGrid" DefaultValue="0" Name="FirstId" PropertyName="SelectedValue" Type="Int32" /> </WhereParameters> </asp:EntityDataSource> <asp:EntityDataSource ConnectionString="name=Entities" DefaultContainerName="Entities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Thirds" EntityTypeFilter="Third" ID="ThirdDataSource" runat="server" Where="it.[SecondId] = @SecondId"> <WhereParameters> <asp:ControlParameter ControlID="SecondGrid" DefaultValue="0" Name="SecondId" PropertyName="SelectedValue" Type="Int32" /> </WhereParameters> </asp:EntityDataSource>