在回发后设置按钮单击网格视图行到顶部 [英] Set Button Clicked Row Of Grid View To Top After Postback

查看:73
本文介绍了在回发后设置按钮单击网格视图行到顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All。



这里有一些我在使用网页视图控件时遇到的问题。

有项目模板具有不同的控件。

i在单击行内的按钮后检索选定的行值。

网格视图中有许多记录。网格视图位于设置为溢出的div内:滚动和div位于更新面板内。



点击按钮后,我获得了完美的值,但点击了行到其原始位置。我需要设置点击行到顶部。

有可能吗?如果可能的话,请帮助我..

等待回复..



先谢谢。

解决方案

据我所知,你想将点击的行移动到网格的顶部。如果是这样,那么你有几个选项,具体取决于gridview的数据源。



如果您使用的是列表,那么您可以从源列表中删除gridview行的单击项并将其插入列表顶部。您需要在此之后重新绑定网格。


如果您只想将当前行移动到顶部并更改数据源中的值,您可以尝试



gridView.SelectedRow.Focus()


从这里获得所需的输出。



www.codeproject.com/Articles/30235 / Maintain-GridView-Scroll-Position-and-Header-Insid



谢谢Codeproject。 :)

Hello All.

Here Some Problem That I am Facing while using grid view controls on my page.
There are item templates having different controls.
i am retrieving selected row values after clicking button inside row.
there are many records in grid view. grid view is inside div that set to overflow:scroll and div is inside update panel.

After clicking button i am getting values perfectly but clicked row going to its original location. what i need to set clicked row to top.
Is It possible ? If possible then please kindly Help me..
Waiting For Reply..

Thanks In Advance.

解决方案

As I understand you want to move the clicked row to the top of the grid.If that is so then you have several options depending on the data source of the gridview.

If you are using a list then you can remove the clicked item for the gridview row from the source list and insert it at the top of the list.You will need to rebind the grid after this.


If you just want to move the current row to the top with changing the values in the data source you can try

gridView.SelectedRow.Focus()


Got Desired Output From Here.

www.codeproject.com/Articles/30235/Maintain-GridView-Scroll-Position-and-Header-Insid

Thanks Codeproject. :)


这篇关于在回发后设置按钮单击网格视图行到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆