Ver Mensaje Individual
  #6 (permalink)  
Antiguo 25/08/2009, 14:13
fgelvez
 
Fecha de Ingreso: agosto-2009
Mensajes: 2
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: gridview cambiar color celda según valor

un poco tarde en responder...

No se si se esta haciendo de la manera correcta... pero a mi me ha funcionado asi....

Resalto las celdas que vacias, en las columnas 0, 2, 3 y 6 en el GridView...

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'' Display the company name in italics.
If e.Row.Cells(0).Text = " " Then
e.Row.Cells(0).BackColor = Drawing.Color.FromArgb(250, 169, 183)
End If
If e.Row.Cells(2).Text = " " Then
e.Row.Cells(2).BackColor = Drawing.Color.FromArgb(250, 169, 183)
End If
If e.Row.Cells(3).Text = " " Then
e.Row.Cells(3).BackColor = Drawing.Color.FromArgb(250, 169, 183)
End If
If e.Row.Cells(6).Text = " " Then
e.Row.Cells(6).BackColor = Drawing.Color.FromArgb(250, 169, 183)
End If
End If
End Sub