changing the forecolor at runtime of label which is present in template field of gridview in asp.net
<p>I am creating one application using gridview of asp.net. Grid view containing one template which having 3 to 4 labels which bind from database values.One label of gridview tamplate forecolor is blue but after selecting row i want to change color to white to selected row label to white but my problem is all other label colors is changed but that blue color label color is remaining.
I am using following code to change color of all labels At gridview selectedindex changed event.
For i As Integer = 0 To GridView1.Rows.Count - 1
            If i = GridView1.SelectedIndex Then</p>

<pre><code>     GridView1.SelectedRow.Attributes.Add("style", "background-image: url('images/weight-loss-li-over.gif'); color : white;")
        Else
            GridView1.Rows(i).ForeColor = Drawing.Color.Black
            GridView1.Rows(i).Font.Bold = False
            GridView1.Rows(i).Attributes.Remove("style")

        End If
    Next
</code></pre>

<p>pls give me any answer?</p>
