This is a migrated thread and some comments may be shown as answers.

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

2 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santosh
Top achievements
Rank 1
Santosh asked on 14 Apr 2012, 07:34 PM

Hello,

          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" >
  
<ContentTemplate>
  
<asp:Panel ID="pnlTopPatientException" runat="server">
  
<asp:Panel ID="pnlPatientException" runat="server" Style="display: none; z-index: 8888;"
  
CssClass="modalPopup">
  
<table border="0" style="width: 100%; height: 30%; border-color: transparent;">
  
<tr>
  
<td align="left">
  
<h1>
  
<asp:Label ID="lblMessage" runat="server" Text="Patient Exceptions" Style="color: Green" />
  
</h1>
  
</td>
  
</tr>
  
<tr>
  
<td>
  
<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" >
  
<Columns>
  
<SJ:CustomFilteringTemplateColumn DataField="FromDate" HeaderStyle-Wrap="false" HeaderText="From Date"
  
HeaderStyle-HorizontalAlign="Center" SortExpression="FromDate" FilterControlWidth="105"
  
DropDownBoxWidth="105" HeaderStyle-Width="8%" AllowFiltering="false">
  
<ItemTemplate>
  
<asp:Label ID="lblFromDate" runat="server" Text='<%#Eval("FromDate","{0:MM/dd/yyyy}")%>'
  
CausesValidation="false">
  
</asp:Label>
  
</ItemTemplate>
  
</SJ:CustomFilteringTemplateColumn>
  
<SJ:CustomFilteringTemplateColumn DataField="ToDate" HeaderStyle-Wrap="false" HeaderText="To Date"
  
HeaderStyle-HorizontalAlign="Center" SortExpression="ToDate" FilterControlWidth="105"
  
DropDownBoxWidth="105" HeaderStyle-Width="8%" AllowFiltering="false">
  
<ItemTemplate>
  
<asp:Label ID="lblToDate" runat="server" Text='<%#Eval("ToDate","{0:MM/dd/yyyy}")%>'
  
CausesValidation="false">
  
</asp:Label>
  
</ItemTemplate>
  
</SJ:CustomFilteringTemplateColumn>
  
<SJ:CustomFilteringTemplateColumn HeaderStyle-Wrap="false" DataField="ExceptionDesc"
  
HeaderText="Exception Description" HeaderStyle-HorizontalAlign="Left" SortExpression="ExceptionDesc"
  
FilterControlWidth="105" DropDownBoxWidth="105" HeaderStyle-Width="52%" AllowFiltering="false">
  
<ItemTemplate>
  
<asp:Label ID="lblExceptionDesc" runat="server" Text='<%#Eval("ExceptionDesc") %>'
  
CausesValidation="false">
  
</asp:Label>
  
</ItemTemplate>
  
</SJ:CustomFilteringTemplateColumn>
  
</Columns>
  
</MasterTableView>
  
</SJ:SJRadGrid>
  
</td>
  
</tr>
  
<tr>
  
<td align="right">
  
<asp:Button ID="btnCloseModal" runat="server" CssClass="button" Text="Close" ToolTip="Close"
  
OnClientClick="return CloseModalPopup();" OnClick="btnCloseModal_Click" />
  
</td>
  
</tr>
  
</table>
  
</asp:Panel>
  
<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" />
  
</asp:Panel>
  
</ContentTemplate>
  
</asp:UpdatePanel>
  
  
In the server side, I have the following on the click of the link button:
  
  
mpePatientException.Enabled = true;
  
mpePatientException.Show();


Any help would be appreciated.  Thanks in advance.

Regards,
Santosh Varma.

2 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 19 Apr 2012, 07:24 AM
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.

Greetings,
Marin
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.
0
Sumila
Top achievements
Rank 1
answered on 21 Sep 2018, 10:46 AM

Hi,

 

I face similar issue. Is this resolved?

Tags
Grid
Asked by
Santosh
Top achievements
Rank 1
Answers by
Marin
Telerik team
Sumila
Top achievements
Rank 1
Share this question
or