Monday, April 25, 2011

GridView DataControlRowType

"DataControlRowType Enumeration (System.Web.UI.WebControls)" ( http://bit.ly/fA1sJ6 )

There are several different row types in a Gridview, each with its own function. When using an event such as RowDataBound (where individual rows are of interest to us), it is important to check for the DataControlRowType.

  • Header
  • Footer
  • DataRow
  • Separator
  • Pager
  • EmptyDataRow     

We can do so. The following example checks for a DataRow (a normal row of data):

If e.Row.RowType = DataControlRowType.DataRow Then

    ' Code...

End If

No comments:

Post a Comment