Any way to manipulate the columns in GridView with AutoGenerateColumns = true?

前端 未结 5 477
谎友^
谎友^ 2020-12-11 17:42

It seems like there\'s no way to manipulate the columns of a Gridview if AutoGenerateColumns = true. Here\'s my scenario:

I\'ve got a generic GridView that displays

5条回答
  •  旧时难觅i
    2020-12-11 18:08

    Brendan's answer reminded me I had this lying around.. Good for formatting.

    GridView...

    
    

    Code Behind...

    Sub myGridView_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
          ' Display the data in italics.
          e.Row.Cells(1).Text = "" & e.Row.Cells(1).Text & ""
        End If
    End Sub
    

提交回复
热议问题