RadGrid for ASP.NET AJAX displayed in a modal popup disappears when the column header is clicked for sorting.

3 posts, 0 answers
  1. Santosh
    Santosh avatar
    1 posts
    Member since:
    Apr 2012

    Posted 14 Apr 2012 Link to this post


              I have placed the radgrid in a panel to invoke with a ModalPopupExtender.  The modal is invoked on a link button click and upon radgrid column header click for sorting, the modal popup closes.  I want the radgrid to stay there whenever column sorting is done in the modal popup. 
              The following is my piece of code:


    <asp:UpdatePanel ID="upMPE" runat="server" >
    <asp:Panel ID="pnlTopPatientException" runat="server">
    <asp:Panel ID="pnlPatientException" runat="server" Style="display: none; z-index: 8888;"
    <table border="0" style="width: 100%; height: 30%; border-color: transparent;">
    <td align="left">
    <asp:Label ID="lblMessage" runat="server" Text="Patient Exceptions" Style="color: Green" />
    <SJ:SJRadGrid ID="grdPatientExceptionList" runat="server" AllowSorting="true" Skin="SJ"
    OnNeedDataSource="GetData" PageSize="5" ShowFooter="true">
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <ItemStyle CssClass="altrow" />
    <MasterTableView PagerStyle-AlwaysVisible="true" Width="100%" AllowSorting="true"
    AllowMultiColumnSorting="true" DataKeyNames="ID" >
    <SJ:CustomFilteringTemplateColumn DataField="FromDate" HeaderStyle-Wrap="false" HeaderText="From Date"
    HeaderStyle-HorizontalAlign="Center" SortExpression="FromDate" FilterControlWidth="105"
    DropDownBoxWidth="105" HeaderStyle-Width="8%" AllowFiltering="false">
    <asp:Label ID="lblFromDate" runat="server" Text='<%#Eval("FromDate","{0:MM/dd/yyyy}")%>'
    <SJ:CustomFilteringTemplateColumn DataField="ToDate" HeaderStyle-Wrap="false" HeaderText="To Date"
    HeaderStyle-HorizontalAlign="Center" SortExpression="ToDate" FilterControlWidth="105"
    DropDownBoxWidth="105" HeaderStyle-Width="8%" AllowFiltering="false">
    <asp:Label ID="lblToDate" runat="server" Text='<%#Eval("ToDate","{0:MM/dd/yyyy}")%>'
    <SJ:CustomFilteringTemplateColumn HeaderStyle-Wrap="false" DataField="ExceptionDesc"
    HeaderText="Exception Description" HeaderStyle-HorizontalAlign="Left" SortExpression="ExceptionDesc"
    FilterControlWidth="105" DropDownBoxWidth="105" HeaderStyle-Width="52%" AllowFiltering="false">
    <asp:Label ID="lblExceptionDesc" runat="server" Text='<%#Eval("ExceptionDesc") %>'
    <td align="right">
    <asp:Button ID="btnCloseModal" runat="server" CssClass="button" Text="Close" ToolTip="Close"
    OnClientClick="return CloseModalPopup();" OnClick="btnCloseModal_Click" />
    <asp:ModalPopupExtender ID="mpePatientException" runat="server" PopupControlID="pnlPatientException"
    BehaviorID="ModalBehaviour" BackgroundCssClass="modalBackground" TargetControlID="dummyButton1"
    Enabled="false" />
    <input type="button" runat="server" style="display: none" id="dummyButton1" />
    In the server side, I have the following on the click of the link button:
    mpePatientException.Enabled = true;

    Any help would be appreciated.  Thanks in advance.

    Santosh Varma.

  2. Marin
    Marin avatar
    1057 posts

    Posted 19 Apr 2012 Link to this post

    Hi Santosh,

     Probably the issue is caused because the grid rebinds which reloads the page and closes the popup. Can you verify that the grid performs an ajax request when the sorting happens? Normally this should keep the popup open. You can also try to ajaxify the RadGrid by using RadAjaxManager if the UpdatePanel does not work correctly in this case.

    Hope this helps.

    the Telerik team
    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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Sumila
    Sumila avatar
    7 posts
    Member since:
    Sep 2018

    Posted 21 Sep 2018 Link to this post



    I face similar issue. Is this resolved?

Back to Top