如何在buttonclick事件中从gridview的所有页面获取所有选定的记录? [英] How to fetch all selected record from all pages of gridview at time in buttonclick event?

查看:41
本文介绍了如何在buttonclick事件中从gridview的所有页面获取所有选定的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网格中显示记录(包含复选框作为第一列),其中包含分页。如果我在第一页选择记录并从第一页开始移至第二页选择记录取消选中。我是否启用viewstate?会发生什么?可以我能够在按钮点击事件中一次获取从网格的所有页面中选择的所有记录(id)吗?



I am showing record in grid(contain checkbox as first column) that has paging.If I select record in page one and move to second page selected record from first get unchecked.Shall I make enable viewstate?What will happen?Can I able to fetch all record(id) which are selected from all pages of grid at a time in button click event?

foreach (GridViewRow rowItem in Gridview1.Rows)
{
}

推荐答案

本文可以帮助您:维护GridView内不同页面中选定CheckBox的状态 [ ^ ]



问候..
This Article may help you : Maintaining States of Selected CheckBoxes in Different Pages inside the GridView[^]

Regards..


这篇关于如何在buttonclick事件中从gridview的所有页面获取所有选定的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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