Question

I want to open RadWindow popup using the partial postback by double clicking on the RadGrid row. But even though I am using UpdatePanel, it is still opening with Full PostBack. Below is my code:

Here is my ASPX.

<asp:UpdatePanel ID="upGrd" runat="server">
    <ContentTemplate>
    <telerik:RadGrid ID="grd" runat="server" AutoGenerateColumns="false">
           <MasterTableView>
                <Columns>
                     <telerik:GridBoundColumn HeaderText="Header" DataField="Field">
                     </telerik:GridBoundColumn>
                     ..................
                     ..................
                     ..................
                </Columns>
           </MasterTableView>   
           <ClientSettings EnableRowHoverStyle="true"> 
                <ClientEvents OnRowDblClick="grd_DblClick" />               
           </ClientSettings>
    </telerik:RadGrid>
    </ContentTemplate>
</asp:UpdatePanel>

<telerik:RadWindowManager ID="RadWindowManager2" runat="server" EnableShadow="true"
        DestroyOnClose="true">
        <Windows>
             <telerik:RadWindow runat="server" ID="winDetailForm" InitialBehaviors="Close" Modal="true" Title="Detail Form" RestrictionZoneID="ContentTemplateZone" VisibleOnPageLoad="False"  Height="550px" Width="700px">
                <ContentTemplate>
                     <asp:UpdatePanel ID="upPopUps" runat="server">
                          <ContentTemplate>
                                My data detail is here which is being shown in PopUp...
                          </ContentTemplate>
                     </asp:UpdatePanel>
                </ContentTemplate>
             </telerik:RadWindow>
        </Windows>
</telerik:RadWindowManager>  

<telerik:RadButton runat="server" ID="btnShowDetail" Text="Show Detail" OnClick="btnShowDetail_Click" Style="display: none"></telerik:RadButton>

<script type="text/javascript">

     function grd_DblClick(sender, args) 
     {
         var btnShowDetail = $find("<%=btnShowDetail.ClientID%>");
         btnShowDetail.click();
     }

</script>

And my code behind is

protected void btnShowDetail_Click(object sender, EventArgs e)
{
     //Fill the PopUp with data and then show it...

     winDetailForm.VisibleOnPageLoad = true;
     winDetailForm.Visible = true;
}
Was it helpful?

Solution

Please try with below code snippet.

Issue is your button (btnShowDetail) is outside the updatepanel, That's why it will open with full postback.

<asp:UpdatePanel ID="upGrd" runat="server">
    <ContentTemplate>
        <telerik:RadGrid ID="grd" runat="server" AutoGenerateColumns="false">
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn HeaderText="Header" DataField="ID">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings EnableRowHoverStyle="true">
                <ClientEvents OnRowDblClick="grd_DblClick" />
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:RadWindowManager ID="RadWindowManager2" runat="server" EnableShadow="true"
            DestroyOnClose="true">
            <Windows>
                <telerik:RadWindow runat="server" ID="winDetailForm" InitialBehaviors="Close" Modal="true" Title="Detail Form" RestrictionZoneID="ContentTemplateZone" VisibleOnPageLoad="False" Height="550px" Width="700px">
                    <ContentTemplate>
                        My data detail is here which is being shown in PopUp...
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <telerik:RadButton runat="server" ID="btnShowDetail" Text="Show Detail" OnClick="btnShowDetail_Click" Style="display: none"></telerik:RadButton>
    </ContentTemplate>
</asp:UpdatePanel>

Let me know if any concern.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top