具有gridview的面板的滚动位置 [英] Scroll Position of a panel having the gridview
本文介绍了具有gridview的面板的滚动位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已将Panel控件添加到包含GridView的网页上.
面板的ScrollBars属性设置为Vertical.当我单击编辑项目"模板一行(显然会导致回发)时,滚动
位置重置到顶部,这意味着我看不到编辑字段.
单击EditItemTemplate(即编辑图片)后,如何保持滚动位置.请帮助
I have added Panel control to a web page which contains a GridView. The
Panel''s ScrollBars property is set to vertical. when I click on Edit Item template for a row (which obviously causes a postback), the scroll
position resets to the top which means I can’t see the edit field.
How can I persist the scroll position after clicking on EditItemTemplate (i.e.Edit image). please help
推荐答案
查看以下链接:
可滚动Web控件中的智能导航 [ ^ ]
http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx [ ^ ]
http://microsoftmiles.blogspot.com/2006/11/maintaining-gridview- scroll-position-in.html [ ^ ]
祝你好运!
Have a look at these links for that:
Smart Navigation in Scrollable Web Controls[^]
http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx[^]
http://microsoftmiles.blogspot.com/2006/11/maintaining-gridview-scroll-position-in.html[^]
Good luck!
您应该在页面声明MaintainScrollPositionOnPostback="true"
中写上它
例如:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" MaintainScrollPositionOnPostback="true"%>
You should write this in the page declarationMaintainScrollPositionOnPostback="true"
So for example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" MaintainScrollPositionOnPostback="true"%>
请参见此 [
See this[^] code project article. I think it is useful.
BTW I gave 5 for you question. When I saw at first, I thought it will done using Ajax update panel. But it isn''t.
这篇关于具有gridview的面板的滚动位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文