- 1
- 0
- 约2.16万字
- 约 43页
- 2021-03-15 发布于山东
- 举报
代码分页排序 :
效果图:
设为 True, aspx 代码中是 AllowSorting=True ;
2.默认 1 页 10 条,如果要修改每页条数,修改 PageSize即可,在 aspx 代码中是 PageSize=12。
3.默认的是单向排序的,右击 GridView 弹出 “属性 ”,选择 AllowSorting 为 True 即可。
1:分页保存选中状态
保存 CheckBox 的值
GridView 在分页过程中并不维护 CheckBox 的选择状态, 幸运的是, 我们可以使用 Session 来维护 CheckBox
的状态,这个功能使用 RememberOldValues 完成
private void RememberOldValues()
{
ArrayList categoryIDList = new ArrayList();
int index = -1;
foreach (GridViewRow row in
{
index =Convert .ToInt32( [].Value);
bool result = ((CheckBox)(IsCheckBox)).Checked;
ows)
{
int index = (int)[].Value;
if (index))
{
CheckBox myCheckBox = (CheckBox)(Is
原创力文档

文档评论(0)