GridView分页期间丢失的值 [英] value lost during gridview paging

查看:53
本文介绍了GridView分页期间丢失的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格视图,其中我隐藏了id列
gv.columns [0] .visible = false;
绑定网格视图后.
我将页面大小设置为10.
现在,在第一页上我可以获取隐藏的ID,但是当我转到第二个网格视图页时,ID ID为空.它无法访问,可能是什么问题... ???

i have a grid view which id column i have hide with
gv.columns[0].visible = false;
after binding the grid view.
i set the page size = 10.
now, on first page i can get the hidden id, but when i go to second grid view page the id id empty. it can not accessed, what might be problem...???

推荐答案

写gv.Columns [0] .Visible = false;在DataBound事件以及gridview的PageIndexChanging事件中.
我确定它将解决您的问题.
write gv.Columns[0].Visible=false; in DataBound Event as well as PageIndexChanging event of gridview.
I am Sure that it will fix your problem.


这篇关于GridView分页期间丢失的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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