
| protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if ("Detail".Equals(e.Item.OwnerTableView.Name)) |
| { |
| if ("InitInsert".Equals(e.CommandName)) |
| { |
| (e.Item as GridEditableItem)["PackageName"].Enabled = true; |
| } |
| } |
| } |
| <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" |
| GridLines="None" AutoGenerateColumns="False" |
| OnInsertCommand="RadGrid1_InsertCommand" |
| OnItemUpdate="RadGrid1_UpdateCommand" |
| OnItemCommand="RadGrid1_ItemCommand"> |
| <HeaderContextMenu EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </HeaderContextMenu> |
| <MasterTableView datasourceid="SqlDataSource1" DataKeyNames="Group_Name" |
| AllowFilteringByColumn="True" Name="Header"> |
| <DetailTables> |
| <telerik:GridTableView runat="server" DataSourceID="SqlDataSource2" |
| DataKeyNames="Group_Name" CommandItemDisplay="Top" Name="Detail" |
| AllowAutomaticUpdates="False" EditMode="PopUp"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="Group_Name" MasterKeyField="Group_Name" /> |
| </ParentTableRelation> |
| <CommandItemSettings AddNewRecordImageUrl="\Images\AddRecord.gif" /> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridEditCommandColumn> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridButtonColumn CommandName="Delete" Text="Delete" |
| UniqueName="column3"> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="Package_Name" UniqueName="PackageName" HeaderText="Package Name" |
| Visible="True" ReadOnly="True"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Group_Name" UniqueName="column2" |
| Visible="False" Display="False" ReadOnly="True"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="ConnectionString" |
| UniqueName="ConnectionString" HeaderText="Connection String"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="FileId" UniqueName="FileId" Visible="False" |
| Display="False" ReadOnly="True"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDropDownColumn DataField="Active" ForceExtractValue="InEditMode" |
| HeaderText="Active" UniqueName="Active" DataSourceID="SqlDataSource3" ListTextField="Active" |
| ListValueField="Active"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridDropDownColumn DataField="InProcess" ForceExtractValue="InEditMode" |
| HeaderText="In Process" UniqueName="InProcess" DataSourceID="SqlDataSource3" ListTextField="Active" |
| ListValueField="Active"> |
| </telerik:GridDropDownColumn> |
| </Columns> |
| <EditFormSettings CaptionFormatString="test"> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| </EditFormSettings> |
| </telerik:GridTableView> |
| </DetailTables> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="Group_Name" /> |
| </ParentTableRelation> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn visible="True"> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Application_Name" UniqueName="column1" |
| HeaderText="Application Name"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Group_Name" UniqueName="Group_Name" |
| HeaderText="Group Name"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |

Hi,
I am using RadWindow to show details of an item. I have image on parent page and using onclick I call the javascript function below. Image is added to the page in code behind like this:
sb.Append(string.Format("<img title=\"Details\" src=\"images/details.png\" onclick=\"ShowWindow('SessionDetails.aspx?id={0}');return false;\"/> ", pid));
var oldUrl;
function ShowWindow(url) {
var oWnd = $find("<%=rwDialog.ClientID%>");
oWnd.setUrl(url);
oWnd.setSize(750, 480);
oWnd.show();
if (oldUrl == url) {
oWnd.reload();
}
oldUrl = url;
}
If I click on image to see details, it works fine. Now if I click on the same item again (without clicking any other item), it show window with the same page but without post back. Thats why I used oldUrl in script above. If page is different from last click, it only sets the url. But I used clicked on the same item, reload will give them fresh page. Problem is that that it gives browser message that page will reload.
Another thing I noticed is that it happens only if I use a close button in my child page. If I use RadWindow's default close button to close the window, I dont get that reload warning. Any ideas how can i avoid that reload message?
This is how I close child window
private void CloseWithoutParentRefresh()
{
string script = string.Format("<script>CloseOnReload()</" + "script>");
ClientScript.RegisterStartupScript(this.GetType(), "CloseOnReload", script);
}
//GetRadWindow obtains a reference to the hosting RadWindow"
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseOnReload(url) {
GetRadWindow().close();
}
<telerik:RadDatePicker ID="dtpAutoCloseDate" style="font-size:100%"
ToolTip="Auto-Close Date (MM/DD/YYYY)" runat="server"
onselecteddatechanged="RadDatePicker1_SelectedDateChanged"
Culture="English (United States)" Calendar-EnableNavigation="true" >
<DateInput runat="server">
<ClientEvents OnError="DateTimeError" />
</DateInput>
<Calendar runat="server" ></Calendar>
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
</telerik:RadDatePicker>
Thank you,
Chris
| <div id="RAD_SPLITTER_PANE_CONTENT_RadPane2" ... > |
| <div> other my customs usercontrol elements </div> |
| <div id="CustomersGridControl1_CustomersGridControl1$RadGridCustomersPanel" ... > |
| <div id="CustomersGridControl1_RadGridCustomer" ...> |
| OTHER GRID ELEMENTS |
| </div> |
| </div> |
| </div> |
