How to Close RadWindow From Inside Button

2 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    12 posts
    Member since:
    Dec 2013

    Posted 09 Feb 2014 Link to this post

    Hi,
    I have created a webpage to insert details of member. Here is the code

    MainPage

    <div id="Master_Div" runat="server">
            <div class="art-layout-cell layout-item-1" style="width: 100%; padding: 0px">
                <telerik:RadButton ID="btn_addNewEmployee" runat="server" AutoPostBack="false" Text="Add New Record" OnClientClicked="showWindow()" Width="150px">
                    <Icon PrimaryIconUrl="~/Design/MeStyle/Input/Add_Button.png" />
                </telerik:RadButton>
            </div>
            <div class="art-layout-cell layout-item-1" style="width: 100%; padding: 0px">
                <telerik:RadGrid ID="RadGrid_Employee" runat="server" AllowFilteringByColumn="True" AllowAutomaticInserts="false"
                    AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="SqlDataSource" GridLines="None"
                    AllowPaging="True" EnableEmbeddedSkins="False" PageSize="5" ShowStatusBar="True" Skin="Metro" OnItemDataBound="RadGrid_Employee_ItemDataBound">
                    <MasterTableView DataKeyNames="ID" DataSourceID="SqlDataSource" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" CommandItemDisplay="Top">
                        <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="false" RefreshText="Refresh" />
                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="No." AllowFiltering="false">
                                <ItemTemplate>
                                    <asp:Label ID="IDLabel" runat="server" Text=""></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="40px" />
                                <ItemStyle HorizontalAlign="Center" Width="40px" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="EmployeeName" FilterControlWidth="100%" FilterControlAltText="Filter EmployeeName column" HeaderText="Name" SortExpression="EmployeeName"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmployeeName">
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" Width="150px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeNumber" FilterControlWidth="100%" FilterControlAltText="Filter EmployeeNumber column" HeaderText="Number" SortExpression="EmployeeNumber"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmployeeNumber">
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" Width="150px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeGSM" FilterControlWidth="100%" FilterControlAltText="Filter EmployeeGSM column" HeaderText="GSM" SortExpression="EmployeeGSM"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmployeeGSM">
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" Width="150px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeEmail" FilterControlWidth="100%" FilterControlAltText="Filter EmployeeEmail column" HeaderText="Email" SortExpression="EmployeeEmail"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmployeeEmail">
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" Width="150px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeIdentificationCardNumber" FilterControlWidth="100%" FilterControlAltText="Filter EmployeeIdentificationCardNumber column" HeaderText="ID Number" SortExpression="EmployeeIdentificationCardNumber"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmployeeIdentificationCardNumber">
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" Width="150px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeContractNumber" FilterControlWidth="100%" FilterControlAltText="Filter EmployeeContractNumber column" HeaderText="Contract Number" SortExpression="EmployeeContractNumber"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmployeeContractNumber">
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" Width="150px" />
                            </telerik:GridBoundColumn>                       
                        </Columns>
                        <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                    </MasterTableView>
                    <FilterItemStyle HorizontalAlign="Center" />
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                    <FilterMenu EnableImageSprites="False" />
                    <HeaderContextMenu EnableEmbeddedSkins="false" />
                </telerik:RadGrid>
     
                <telerik:RadWindowManager ID="RadWindowManager_modalPopup" runat="server">
                    <Windows>
                        <telerik:RadWindow ID="modalPopup" runat="server" Width="980px" Height="550px" VisibleStatusbar="false"
                            EnableEmbeddedSkins="false" Skin="Metro" Modal="true" Behaviors="Close"
                            NavigateUrl="~/Forms/Employee/EmployeeManagement/Add/EmployeeManagementAddTemplate.aspx" >
                        </telerik:RadWindow>
                    </Windows>
                </telerik:RadWindowManager>
            </div>


    It opens a radwindow inside a webform

    webform

    <div class="modalpopup_masterdiv">
            <telerik:RadTabStrip ID="RadTabStrip_EmployeeDetails" SelectedIndex="0" Width="100%" runat="server" MultiPageID="Employee_General" Skin="Metro">
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="Employee_PageView" runat="server" SelectedIndex="0">
                <telerik:RadPageView runat="server" ID="Employee_PageView1">
                    <div class="modalpopup_masterdiv">
                        <span class="tab-title">Official Details</span>
                    </div>
                    <div class="modalpopup_masterdiv" style="overflow-x: hidden; height: 340px;">
                        <div class="modalpopup_div">
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeName" AssociatedControlID="txt_EmployeeName" runat="server" Text="Employee Name:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadTextBox ID="txt_EmployeeName" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                    </telerik:RadTextBox>
                                    <asp:RequiredFieldValidator ID="EmployeeNameRequired" runat="server" ControlToValidate="txt_EmployeeName" ErrorMessage="*" ForeColor="Red" ValidationGroup="btn_PageView1" />
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeNumber" AssociatedControlID="txt_EmployeeNumber" runat="server" Text="Employee Number:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadTextBox ID="txt_EmployeeNumber" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                    </telerik:RadTextBox>
                                    <asp:RequiredFieldValidator ID="EmployeeNumberRequired" runat="server" ControlToValidate="txt_EmployeeNumber" ErrorMessage="*" ForeColor="Red" ValidationGroup="btn_PageView1" />
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeGSM" AssociatedControlID="txt_EmployeeGSM" runat="server" Text="Employee GSM:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadTextBox ID="txt_EmployeeGSM" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                    </telerik:RadTextBox>
                                    <asp:RequiredFieldValidator ID="EmployeeGSMRequired" runat="server" ControlToValidate="txt_EmployeeGSM" ErrorMessage="*" ForeColor="Red" ValidationGroup="btn_PageView1" />
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeEmail" AssociatedControlID="txt_EmployeeEmail" runat="server" Text="Email:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadTextBox ID="txt_EmployeeEmail" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                    </telerik:RadTextBox>
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_Department" AssociatedControlID="cmb_department" runat="server" Text="Department:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadComboBox runat="server" ID="cmb_department" AppendDataBoundItems="True" MaxHeight="250" CausesValidation="False" CollapseDelay="10" DataMember="DefaultView"
                                        ExpandDelay="0" ItemRequestTimeout="0" Width="80%" MarkFirstMatch="True" EmptyMessage="- Select Department -"
                                        DataSourceID="SqlDataSource_Department" DataTextField="DepartmentName" DataValueField="ID" />
                                    <asp:RequiredFieldValidator ID="DepartmentNameRequired" runat="server" ControlToValidate="cmb_department" ErrorMessage="*" ForeColor="Red" ValidationGroup="btn_PageView1" />
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeDateOfHiring" AssociatedControlID="txt_EmployeeDateOfHiring" runat="server" Text="Date Of Hiring:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadDatePicker ID="txt_EmployeeDateOfHiring" runat="server" Width="80%">
                                        <DateInput ID="DateInput" runat="server" Font-Size="Medium" DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy">
                                            <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                            <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                        </DateInput>
                                    </telerik:RadDatePicker>
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeGender" AssociatedControlID="cmb_EmployeeGender" runat="server" Text="Gender:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadComboBox runat="server" ID="cmb_EmployeeGender" AppendDataBoundItems="True" CausesValidation="False" CollapseDelay="10" DataMember="DefaultView"
                                        ExpandDelay="0" ItemRequestTimeout="0" Width="80%" MarkFirstMatch="True">
                                        <Items>
                                            <telerik:RadComboBoxItem runat="server" Text="Male" Value="Male" />
                                            <telerik:RadComboBoxItem runat="server" Text="Female" Value="Female" />
                                            <telerik:RadComboBoxItem runat="server" Text="Other" Value="Other" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </div>
                            </div>
                        </div>
                        <div class="modalpopup_div">
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_CommercialActivity" AssociatedControlID="cmb_commercialActivity" runat="server" Text="Commercail Activity:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadComboBox runat="server" ID="cmb_commercialActivity" MaxHeight="250" AppendDataBoundItems="True" CausesValidation="False" CollapseDelay="10"
                                        DataMember="DefaultView" ExpandDelay="0" ItemRequestTimeout="0" Width="80%" MarkFirstMatch="True" EmptyMessage="- Select Commercial Activity -"
                                        DataSourceID="SqlDataSource_CommercialActivity" DataTextField="CommercialActivityEnglishName" DataValueField="ID" />
                                    <asp:RequiredFieldValidator ID="CommercialActivityRequired" runat="server" ControlToValidate="cmb_commercialActivity" ErrorMessage="*" ForeColor="Red" ValidationGroup="btn_PageView1" />
                                </div>
                            </div>                       
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeRelativeGSM" AssociatedControlID="txt_EmployeeRelativeGSM" runat="server" Text="Employee Relative GSM:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadTextBox ID="txt_EmployeeRelativeGSM" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                    </telerik:RadTextBox>
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeAddress" AssociatedControlID="txt_EmployeeAddress" runat="server" Text="Address:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadTextBox ID="txt_EmployeeAddress" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                    </telerik:RadTextBox>
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_JobTitle" AssociatedControlID="cmb_JobTitle" runat="server" Text="Job Title:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadComboBox runat="server" ID="cmb_JobTitle" MaxHeight="250" AppendDataBoundItems="True" CausesValidation="False" CollapseDelay="10" DataMember="DefaultView"
                                        ExpandDelay="0" ItemRequestTimeout="0" Width="80%" MarkFirstMatch="True"
                                        DataSourceID="SqlDataSource_JobTitle" DataTextField="JobTitleName" DataValueField="ID" />
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeNationality" AssociatedControlID="cmb_EmployeeNationality" runat="server" Text="Nationality:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadComboBox runat="server" ID="cmb_EmployeeNationality" MaxHeight="250px" AppendDataBoundItems="True" CausesValidation="False" CollapseDelay="10" DataMember="DefaultView"
                                        ExpandDelay="0" ItemRequestTimeout="0" Width="80%" MarkFirstMatch="True" EmptyMessage="-- Select Nationality --"
                                        DataSourceID="SqlDataSource_Nationality" DataTextField="NationalityName" DataValueField="ID" />
                                    <asp:RequiredFieldValidator ID="EmployeeNationalityRequired" runat="server" ControlToValidate="cmb_EmployeeNationality" ErrorMessage="*" ForeColor="Red" ValidationGroup="btn_PageView1" />
                                </div>
                            </div>
                            <div class="modalpopup_masterdiv">
                                <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                    <asp:Label ID="label_EmployeeQualification" AssociatedControlID="cmb_EmployeeQualification" runat="server" Text="Qualification:" />
                                </div>
                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                    <telerik:RadComboBox runat="server" ID="cmb_EmployeeQualification" MaxHeight="250px" AppendDataBoundItems="True" CausesValidation="False" CollapseDelay="10" DataMember="DefaultView"
                                        ExpandDelay="0" ItemRequestTimeout="0" Width="80%" MarkFirstMatch="True"
                                        DataSourceID="SqlDataSource_Qualification" DataTextField="QualificationName" DataValueField="ID" />
                                </div>
                            </div>
                        </div>
                        <div class="modalpopup_masterdiv">
                            <div class="art-layout-cell layout-item-4" style="width: 40%;">
                                <asp:Label ID="label_EmployeeOfficialJobTitleAtTheMinistryOfManpower" AssociatedControlID="txt_EmployeeOfficialJobTitleAtTheMinistryOfManpower" runat="server" Text="Official Job Title At The Ministry Of Manpower :" />
                            </div>
                            <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                <telerik:RadTextBox ID="txt_EmployeeOfficialJobTitleAtTheMinistryOfManpower" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%">
                                    <HoveredStyle Font-Bold="True" ForeColor="#FF3400" />
                                    <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                </telerik:RadTextBox>
                            </div>
                        </div>
                    </div>
                    <div class="modalpopup_masterdiv">
                        <div class="modalpopup_div_right">
                            <telerik:RadButton ID="btn_nextPageView1" ValidationGroup="btn_PageView1" Skin="Metro" runat="server" Width="100px" Text="Next" OnClick="btn_nextPageView1_Click" />
                        </div>
                    </div>
                </telerik:RadPageView>    
                <telerik:RadPageView runat="server" ID="Employee_PageView5">
                    <div class="modalpopup_masterdiv">
                        <span class="tab-title">Attachments</span>
                    </div>
                    <div class="modalpopup_masterdiv" style="overflow-x: hidden !important; height: 340px;">
                        <telerik:RadGrid ID="RadGrid_EmployeeAttachment" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowFilteringByColumn="True"
                            AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="SqlDataSource_EmployeeAttachment" GridLines="None"
                            EnableEmbeddedSkins="False" PageSize="5" ShowStatusBar="True" AllowPaging="True" OnInsertCommand="RadGrid_EmployeeAttachment_InsertCommand"
                            OnItemDataBound="RadGrid_EmployeeAttachment_ItemDataBound" OnItemCommand="RadGrid_EmployeeAttachment_ItemCommand" Skin="Metro">
                            <MasterTableView DataKeyNames="ID" DataSourceID="SqlDataSource_EmployeeAttachment" AutoGenerateColumns="false" PageSize="10" CommandItemDisplay="Top">
                                <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Add Attachment" RefreshText="Refresh" />
                                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridTemplateColumn HeaderText="No." AllowFiltering="false">
                                        <ItemTemplate>
                                            <asp:Label ID="IDLabel" runat="server" Text=""></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="40px" />
                                        <ItemStyle HorizontalAlign="Center" Width="40px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn Visible="false" DataField="ID" DataType="System.Int64" FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="AttachmentName" FilterControlWidth="100%" FilterControlAltText="Filter AttachmentName column" HeaderText="AttachmentName" SortExpression="AttachmentName"
                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="AttachmentName">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Visible="false" DataField="AttachmentPath" DataType="System.Int64" FilterControlAltText="Filter AttachmentPath column" HeaderText="AttachmentPath" ReadOnly="True" SortExpression="AttachmentPath" UniqueName="AttachmentPath">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridHyperLinkColumn AllowFiltering="false" DataNavigateUrlFields="AttachmentPath" Target="_blank" DataNavigateUrlFormatString="{0}" HeaderText="View" Text="View" ImageUrl="~/Design/MeStyle/Grid/view-detail-icon.png">
                                        <HeaderStyle HorizontalAlign="Center" Width="60px" />
                                        <ItemStyle HorizontalAlign="Center" Width="60px" />
                                    </telerik:GridHyperLinkColumn>
                                    <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Delete">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="DeleteLink" ImageUrl="~/Design/MeStyle/Grid/Delete.gif" runat="server" CommandName="Delete" />
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="40px" />
                                        <ItemStyle HorizontalAlign="Center" Width="40px" />
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <EditFormSettings EditFormType="Template">
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column" />
                                    <FormTemplate>
                                        <div class="art-layout-cell layout-item-1" style="width: 100%; padding-top: 10px;">
                                            <div class="art-layout-cell layout-item-1" style="width: 100%;">
                                                <div class="art-layout-cell layout-item-4" style="width: 30%;">
                                                    <asp:Label ID="label_AttachmentName" AssociatedControlID="txt_AttachmentName" runat="server" Text="Attachment Name:" />
                                                </div>
                                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                                    <telerik:RadTextBox ID="txt_AttachmentName" runat="server" InvalidStyleDuration="100" SelectionOnFocus="SelectAll" Width="80%" Text='<%#Bind("AttachmentName")%>'>
                                                        <HoveredStyle Font-Bold="True" ForeColor="#FF3300" />
                                                        <EnabledStyle BackColor="Azure" PaddingRight="10px" />
                                                    </telerik:RadTextBox>
                                                    <asp:RequiredFieldValidator ID="AttachmentNameRequired" runat="server" ControlToValidate="txt_AttachmentName" ErrorMessage="*" ForeColor="Red" />
                                                </div>
                                            </div>
                                            <div class="art-layout-cell layout-item-1" style="width: 100%; padding-top: 10px;">
                                                <div class="art-layout-cell layout-item-4" style="width: 30%;">
                                                    <asp:Label ID="label_AttachmentPath" AssociatedControlID="RPAttachmentPath" runat="server" Text="Attachment Path:" />
                                                </div>
                                                <div class="art-layout-cell layout-item-4" style="width: 60%;">
                                                    <telerik:RadAsyncUpload ID="RPAttachmentPath" runat="server" AllowedFileExtensions="pdf" MaxFileInputsCount="1" InputSize="43"
                                                        PostbackTriggers="button_Update_1" EnableInlineProgress="false">
                                                        <Localization Cancel="Cancel" Select="Select" Remove="Remove" />
                                                    </telerik:RadAsyncUpload>
                                                    <telerik:RadProgressArea ID="RadProgressArea1" runat="server" />
                                                </div>
                                            </div>
                                            <div class="art-layout-cell layout-item-1" style="width: 100%;">
                                                <div class="art-layout-cell layout-item-4" style="width: 100%; padding-left: 10px;">
                                                    <telerik:RadButton ID="button_Update_1" runat="server" Width="100px" Text='<%# IIf((TypeOf (Container) Is GridEditFormInsertItem), "Add", "Update")%>'
                                                        CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' />
                                                    <telerik:RadButton ID="button_Cancel" Width="100px" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" />
                                                </div>
                                            </div>
                                        </div>
                                    </FormTemplate>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                            <HeaderContextMenu EnableEmbeddedSkins="False">
                            </HeaderContextMenu>
                        </telerik:RadGrid>
                    </div>
                    <div class="modalpopup_masterdiv">
                        <div class="modalpopup_div">                       
                            <telerik:RadButton ID="btn_prePageView5" runat="server" Skin="Metro" Width="100px" Text="Previous" OnClick="btn_prePageView5_Click" />
                        </div>
                        <div class="modalpopup_div_right">
                            <telerik:RadButton ID="btn_finishPageView5" runat="server" Skin="Metro" Width="100px" Text="Finish" OnClick="btn_finishPageView5_Click" />
                        </div>
                    </div>
                </telerik:RadPageView>
            </telerik:RadMultiPage>
             
        </div>


    what i'm searching for is, when i click 'btn_finishPageView5' i need to close the radwindow


    Regards,
    Mohammed
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 10 Feb 2014 Link to this post

    Hi Mohammed,

    Please examine this demo: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx. The dialog.aspx page shows a couple of JavaScript functions that will let you close the RadWindow from inside the content page:
    function closeWin() {
         GetRadWindow().close();
    }
    function GetRadWindow() {
         var oWindow = null; if (window.radWindow)
              oWindow = window.radWindow; else if (window.frameElement.radWindow)
                   oWindow = window.frameElement.radWindow; return oWindow;
    }


    You can call the closeWin() function in the OnClientClicked event of the RadButton (and have its AutoPostBack property set to false): http://www.telerik.com/help/aspnet-ajax/button-onclientclicked.html.

    Alternatively, if you need the postback to get some work done on th server before closing the dialog, you can register a script from the server that will call this function: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-javascript-from-server-side.html.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top