Imports System.Xml

Public Class DlgDataGrid
  Private azulClaro As New SolidColorBrush(Colors.LightSkyBlue)
  Private colorPredeterminado As New SolidColorBrush(Colors.White)

  Private Sub dgAlumnos_LoadingRow(sender As System.Object, e As System.Windows.Controls.DataGridRowEventArgs)
    ' Comprobar los datos de esta fila
    Dim filaActual As XmlNode = TryCast(e.Row.DataContext, XmlNode)
    Dim sbeca As String = filaActual("beca").InnerText
    ' Aplicar formato a la fila si...
    If sbeca.CompareTo("True") = 0 Then
      e.Row.Background = azulClaro
    Else
      ' Restaurar el color predeterminado para asegurar que
      ' las filas recargadas con formato son restauradas
      e.Row.Background = colorPredeterminado
    End If
  End Sub
End Class
