Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/07/2007, 10:32
Avatar de mdavila
mdavila
 
Fecha de Ingreso: julio-2007
Ubicación: Montevideo (Uruguay)
Mensajes: 919
Antigüedad: 17 años, 6 meses
Puntos: 13
Re: Pintar de dos colores alternativos las filas de un datagrid

Esto lo que yo hago.... suerte y espero te ayude

Private Sub DgAutos_ItemCreated1(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DgAutos.ItemCreated
Dim itemType As ListItemType

itemType = CType(e.Item.ItemType, ListItemType)
If (itemType <> ListItemType.Header And itemType <> ListItemType.Pager) Then
If (itemType <> ListItemType.AlternatingItem) Then
e.Item.Attributes.Add("OnMouseOver", "this.style.backgroundColor = '#E8E8E8';")
e.Item.Attributes.Add("OnMouseOut", "this.style.backgroundColor = 'white';")
Else
e.Item.Attributes.Add("OnMouseOver", "this.style.backgroundColor = '#E8E8E8';")
e.Item.Attributes.Add("OnMouseOut", "this.style.backgroundColor = 'white';")
End If

End If
End Sub