Community discussion forum

GridView cell colour change

  • 6 months ago

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

        Dim i As Integer
    
       ** If (e.Row.RowType = DataControlRowType.DataRow) Then
            For i = 0 To e.Row.Cells.Count - 1
                e.Row.Cells(i).Attributes("onfocusin") = "GDcolorchange(this,true)"
                e.Row.Cells(i).Attributes("onfocusout") = "GDcolorchange(this,false)"
            Next
        End If**
    End Sub
    
  • 6 months ago

    If u want to change Color of Particular Cell,Then U can do it like This Way:

    U can directly go ahead and put conditions for which u want to change font color:

    If Condition=True then Color -Change else Put Down Same Color Of That Grid row:

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!