GridView在行选择后滚动回顶部 [英] GridView is scrolling back to top after row selection
本文介绍了GridView在行选择后滚动回顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
MaintainScrollPositionOnPostback =true
这是在.NET 2.0中添加的,并在页面中添加了一些JavaScript以确保页面向下滚动到引起回发的控件。
可以享受美食。
I've got one long GridView control on ma website. It allows row selection. The problem is, when I scroll down this GridView and select some of the bottom rows the selection occurs, but whole GridView is scrolling back to top. Does enyone know how to avoid this?
解决方案
If it's happening during a postback, then in your <%@ Page %> directive you can add the following:
MaintainScrollPositionOnPostback="true"
This was added in .NET 2.0, and adds some JavaScript to the page to ensure that the page scrolls back down to the control that caused the postback.
Works a treat.
这篇关于GridView在行选择后滚动回顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文