GridViewで参照可能な非表示列

 

GridViewで参照可能な非表示列。

RowCreatedイベントで非表示にすればいいみたい。

サンプル
Protected Sub GVCast_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GVCast.RowCreated

    If e.Row.RowType = DataControlRowType.DataRow _
      OrElse e.Row.RowType = DataControlRowType.Header Then
        e.Row.Cells(1).Visible = False
        e.Row.Cells(2).Visible = False
        e.Row.Cells(4).Visible = False
        e.Row.Cells(5).Visible = False
        e.Row.Cells(6).Visible = False
        e.Row.Cells(7).Visible = False
        e.Row.Cells(8).Visible = False
        e.Row.Cells(9).Visible = False
        e.Row.Cells(11).Visible = False
        e.Row.Cells(12).Visible = False
    End If

End Sub

参考

restinpiece @ ウィキ - GRIDVIEWで隠し列作成
http://www13.atwiki.jp/restinpiece/pages/24.html

コメント

このブログの人気の投稿

ダブルクォーテーションで括られたCSVカ​ンマ区切りテキストファイルを SQL Server で Bulk Insert する方法

PowerShellでTSV/CSVの列を絞り込んで抽出し、(先頭/行末)からN行出力する

IKEAの鏡を壁に取り付ける