分页时在Gridview中维护下拉列表值 [英] Maintaining drop down list value in Gridview while paging

查看:70
本文介绍了分页时在Gridview中维护下拉列表值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在分页时在gridview中维护下拉列表选择的值.当我转到下一页时,它正在清除或显示selectedindex = 0.如果我移至下一页或上一页,它应该保持选定的下拉值.当通过gridview分页时,维护下拉列表选择是没有意义的,因为每一行的值可能不同.除非下拉列表不在网格之外,否则在这种情况下,您将像其他任何ASP.NET控件一样保持选择状态.带有viewstate会话,缓存,以及任何适合您的用法.


请参考以下线程:
在GridView控件中分页时维护DropDownList中的选定值 [从gridview的下拉列表中丢失选定的值 [ 解决方案

It isn''t clear what you are trying to accomplish, but when paging through a gridview maintaining a dropdownlist selection wouldn''t make sense, as the values for each row may be different. Unless the dropdownlist is outside of the grid, in which case you maintain the selection state as you would any other ASP.NET control; with viewstate session, cache, whatever is appropriate for your usage.


Please refer following threads:
Maintaining the Selected Values in DropDownList While Paging in a GridView Control[^]
Losing selected value from a dropdownlist in gridview[^]


这篇关于分页时在Gridview中维护下拉列表值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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