RowDataBound and the different states conditions

I constantly need to look this up and always see post surround this subject.  The following condition will aide you in determining the state the row is in in a GridView.  The real key is the first statement.

If (e.Row.RowState And DataControlRowState.Edit) > 0 Then
'Edit Row
ElseIf e.Row.RowType = DataControlRowType.DataRow Then
'Data Rows
ElseIf e.Row.RowType = DataControlRowType.Header Then
'Header Row
ElseIf e.Row.RowType = DataControlRowType.Footer Then
'Footer Row
ElseIf e.Row.RowType = DataControlRowType.EmptyDataRow Then
'Empty Row
End If

 

Published Friday, September 19, 2008 1:58 PM by rojay12

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)