I\'m trying to write a small method to loop through and find a GridView Column by its Index, since it can change position based on what might be visible.
Protected Function GetColumnIndexByHeaderText(grid As GridView, findHeader As String) As Integer
Dim i As Integer = 0
For i = 0 To grid.Columns.Count - 1
If grid.Columns(i).HeaderText.ToLower().Trim() = findHeader.ToLower().Trim() Then
Return i
End If
Next
Return -1
End Function