** GridView中的复选框选择** [英] **Check Box Select in GridView**

查看:81
本文介绍了** GridView中的复选框选择**的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我在gridview中有复选框。我的gridview页面大小= 10,

我在第1页中选中了一个复选框并在第2页中选中了另一个复选框

但在此过程中我的第1页中的复选框未取消选中。



可能是因为页面索引发生变化但是hw可以解决这个问题吗?



任意解决方案???

解决方案

真的很简单,你所要做的就是:



< blockquote class =FQ>

Quote:

1。循环遍历PageIndexChanging事件中的网格视图行

2.找到每行中的复选框,看看是否已选中

3.更新会话中的选中值



请参阅类似文章的链接:

在分页时维护CheckBox的状态GridView控件 [ ^ ]





- Amit


我认为这篇文章将解决您的问题..

http://www.aspdotnet-suresh。 com / 2010/04 / maintain-of-checkboxes-while.html [ ^ ]

也可以看到..

在GridView内不同页面中保留选定复选框的状态 [ ^ ]


Hi Friends,
I've checkbox in my gridview. My gridview page size=10,
i've selected one checkbox in page 1 and selected another checkbox
in page 2 but during this process my checkbox in page 1 was unselect.

It may be because of page index changing but hw can solve this problem??

Any solution???

解决方案

It's quite simple really, all you have to do is:

Quote:

1. Loop through the grid view rows in your PageIndexChanging event
2. Find the check box in each row and see whether it's checked
3. Update the checked value in session


Refer the link for similar article:
Maintaining State of CheckBoxes While Paging in a GridView Control[^]


--Amit


I think this article will solve your problem..
http://www.aspdotnet-suresh.com/2010/04/maintaining-state-of-checkboxes-while.html[^]
Also can see..
Maintaining States of Selected CheckBoxes in Different Pages inside the GridView[^]


这篇关于** GridView中的复选框选择**的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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