学习:GridView中asp:BoundField的Visible=false时,无法取到这个字段的值

把asp:BoundField的Visible设置为false,肯定取不到值。

两种方法:

1。设置width=0

2。创建Row后立即隐藏。

protected  void  GridView1_RowCreated(object  sender,  GridViewRowEventArgs  e)
{
e.Row.Cells[0].Visible  =  false;
e.Row.Cells[1].Visible  =  false;
......
}

posted @ 2009-02-26 15:39  Leo Tin  阅读(2336)  评论(0)    收藏  举报