
Hi,
I'm getting following error on my boolean variable assignment. Could you please help with this error (kind of urgent)? Thank You:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsNothing(Initialized) = True Then
Initialized = False
PrevLoc = ""
End If
End Sub
Private Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim CurrentLoc As String
Dim drv As DataRowView
If IsNothing(Initialized) = False Then
Dim X
X = Initialized
MsgBox("Orhan")
X = True
Initialized = X
drv = e.Row.DataItem("Loc")
PrevLoc = drv.Row.Item("Loc")
PreviousColor = System.Drawing.Color.Blue
Exit Sub
End If
If e.Row.RowType = DataControlRowType.DataRow And Initialized = True Then
drv = e.Row.DataItem
CurrentLoc = drv("Loc").ToString()
If CurrentLoc <> PrevLoc Then
If PreviousColor = System.Drawing.Color.Blue Then
e.Row.BackColor = System.Drawing.Color.Green
PreviousColor = System.Drawing.Color.Green
Else
e.Row.BackColor = System.Drawing.Color.Blue
PreviousColor = System.Drawing.Color.Blue
End If
End If
End If
PrevLoc = CurrentLoc
End Sub