Gridview常用操作

  1. 禁止某一列自动换行
       1: Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
       2:     If e.Row.RowType = DataControlRowType.DataRow Then
       3:         '指定某些列不允许换行是可以搞定这事
       4:         For Each Cell As TableCell In e.Row.Cells
       5:             Cell.Wrap = False
       6:         Next
       7:     End If
       8:     ' GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:false")
       9: End Sub
  2. 导出Gridview数据到EXCEL

     http://www.cnblogs.com/vagerent/archive/2007/03/12/672171.html

  

posted @ 2010-09-29 16:30  .将  阅读(203)  评论(0编辑  收藏  举报