网格视图排序刷新整个页面,其他网格视图中的其他排序消失 [英] Grid view sorting refreshes whole page and other sorting from another gridview dissapears
问题描述
我在一个页面上有两个网格,当我从第一个网格中过滤一列时,它会正确排序,但是当我从第二个网格中对列进行排序时,整个页面都会刷新,而第一个网格中的排序就会消失.
我如何防止它发生,因为对我来说都是独立的网格.
我正在使用它进行排序...
受保护的Sub GvBankBookDetails_Sorting(ByVal发送者作为对象,ByVal e作为System.Web.UI.WebControls.GridViewSortEventArgs)处理GvBankBookDetails.Sorting
请帮帮我..........
谢谢
Satej
嗨satej ...
为了防止刷新整个页面,您需要为每个网格使用UpdatePanel,分别为两个网格添加updatepanel.
你这样尝试
首先将脚本管理器添加到您的源代码中.
< asp:ScriptManager ID = " runat =" >> < /asp:ScriptManager >
然后添加这样的更新面板
第一格
< asp:updatepanel id =" runat =" 服务器" updatemode 有条件的" ">> < contenttemplate > //将grid1听到 < /contenttemplate > < /asp:updatepanel >
第二格
< asp:updatepanel id =" runat =" 服务器" updatemode 有条件的" ">> < contenttemplate > //将grid2听到 < /contenttemplate > < /asp:updatepanel >
最好的
谢谢与问候
Sandeep
如果,您在其中启用了 您的GridView,这也会引起回发,您可以" 通过将AJAX 添加到您的页面. 效率最高的简单方法 >到 到您的页面,然后添加 UpdatePanel控件" .
<当我单击[pre 1 2 3 next]的下面时,我已显示8张图像,然后该图像框显示新/下一个图像.但是我没有使用datagrid视图.
I have two grids on one page, when i filter a column from first grid it get sorted properly but when i sort column from the second grid whole page get refreshed and sorting in the first grid disappears.
how do I prevent it from happening because for me both are independent grids.
i am using this for sorting...
Protected Sub GvBankBookDetails_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GvBankBookDetails.Sorting
Please help me..........
Thanks
Satej
hi satej...
For preventing Refreshing the whole page,you need UpdatePanel for each grid, add updatepanel for two grids separately.
you try like this
first add script manager to your sourse code.
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
then add update panel like this
1st grid
<asp:updatepanel id="updateGrid1" runat="server" updatemode="Conditional" > <contenttemplate> //place your grid1 hear </contenttemplate> </asp:updatepanel>
2nd grid
<asp:updatepanel id="updateGrid2" runat="server" updatemode="Conditional" > <contenttemplate> //place your grid2 hear </contenttemplate> </asp:updatepanel>
All the Best
Thanks&&Regards
Sandeep
if you have sorting enabled in your GridView, that will also cause a postback, which you can "hide" by adding AJAX to your page. A simple (not the most efficient) way to do this will be to add a ScriptManager control to your page to enable AJAX controls in it, then add an UpdatePanel control and move your GridView inside this UpdatePanel. This will make the PostBacks "invisible".
I have displayed 8 images when i have click the below of the [pre 1 2 3 next] then this images box have new/next images display. Yet i am not use the datagrid view.
这篇关于网格视图排序刷新整个页面,其他网格视图中的其他排序消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!