Imports DevExpress.Web

Public Class ucHistorialConfiguracionEvaluacion
    Inherits ucBase

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RegisterCustomMessage(cbpConfiguracion)
        If Not IsPostBack Then
            Session("plaza") = ""
        End If
    End Sub

    Protected Sub cbpConfiguracion_Callback(sender As Object, e As DevExpress.Web.CallbackEventArgsBase) Handles cbpConfiguracion.Callback
        'CustomMessage(e.Parameter.ToString(), "prueba", cbpConfiguracion)
    End Sub

    Protected Sub gridCalificaciones_BeforePerformDataSelect(sender As Object, e As EventArgs)
        Session("idConfiguracionEvaluacion") = (TryCast(sender, ASPxGridView)).GetMasterRowKeyValue()
    End Sub

    Protected Sub gridEvaluacion_DataBound(sender As Object, e As EventArgs) Handles gridEvaluacion.DataBound
        TryCast(sender, ASPxGridView).DetailRows.ExpandAllRows()

    End Sub


    Protected Sub gridEvaluacion_HtmlFooterCellPrepared(sender As Object, e As ASPxGridViewTableFooterCellEventArgs) Handles gridEvaluacion.HtmlFooterCellPrepared
        Dim g As ASPxGridView = TryCast(sender, ASPxGridView)
        If e.GetSummaryValue(g.TotalSummary("puntaje", DevExpress.Data.SummaryItemType.Sum)) = 100 Then
            e.Cell.BackColor = Drawing.Color.LimeGreen
        Else
            e.Cell.BackColor = Drawing.Color.IndianRed
        End If
    End Sub

    Protected Sub gridCalificaciones_HtmlFooterCellPrepared(sender As Object, e As ASPxGridViewTableFooterCellEventArgs)
        Dim g As ASPxGridView = TryCast(sender, ASPxGridView)
        If e.GetSummaryValue(g.TotalSummary("peso", DevExpress.Data.SummaryItemType.Sum)) = 100 Then
            e.Cell.BackColor = Drawing.Color.LimeGreen
        Else
            e.Cell.BackColor = Drawing.Color.IndianRed
        End If
    End Sub

    Protected Sub gridCalificaciones_DataBound(sender As Object, e As EventArgs)
        TryCast(sender, ASPxGridView).DetailRows.ExpandAllRows()
    End Sub

    Protected Sub cmbConcursoEvaluar_DataBound(sender As Object, e As EventArgs) Handles cmbConcursoEvaluar.DataBound
        CType(sender, ASPxComboBox).NullText = CType(sender, ASPxComboBox).Items.Count & " concursos disponibles."
    End Sub
End Class