protected void pgCompetencias_CellDataBound(object sender, Telerik.Web.UI.PivotGridCellDataBoundEventArgs e) { int vNoValorCompetencia; if (e.Cell is PivotGridColumnHeaderCell) { E_COMPARACION_COMPETENCIA vEmpleado = ComparacionCompetencias.Where(t => t.CL_EMPLEADO.Equals(e.Cell.DataItem.ToString())).FirstOrDefault(); if (vEmpleado != null) { e.Cell.ToolTip = vEmpleado.NB_EMPLEADO; e.Cell.Text = String.Format("<a href='#' onclick='OpenInventario({1})'>{0}</a>", vEmpleado.CL_EMPLEADO, vEmpleado.ID_EMPLEADO); oListaEmpleados.Add(e.Cell.DataItem.ToString()); } } if (e.Cell is PivotGridRowHeaderCell) { if (e.Cell.Controls.Count > 1) { (e.Cell.Controls[0] as Button).Visible = false; } } else if (e.Cell is PivotGridDataCell) { PivotGridDataCell celda = (PivotGridDataCell)e.Cell; if (celda.IsGrandTotalCell) { celda.Text = "<div style=\"text-align: center;\">" + obtenerPromedio(oListaEmpleados[celda.ColumnIndex]).ToString() + "</div>"; } else { System.Web.UI.HtmlControls.HtmlGenericControl divColor = celda.FindControl("divColorComparacion") as System.Web.UI.HtmlControls.HtmlGenericControl; System.Web.UI.HtmlControls.HtmlGenericControl divPromedio = celda.FindControl("divPromedio") as System.Web.UI.HtmlControls.HtmlGenericControl; System.Web.UI.HtmlControls.HtmlGenericControl divNa = celda.FindControl("divNa") as System.Web.UI.HtmlControls.HtmlGenericControl; System.Web.UI.HtmlControls.HtmlGenericControl divNc = celda.FindControl("divNc") as System.Web.UI.HtmlControls.HtmlGenericControl; if (e.Cell.DataItem != null) { if ((decimal)e.Cell.DataItem == Convert.ToDecimal(-1)) { //e.Cell.Text = "<div style=\"text-align: center;\">N/C</div>"; //e.Cell.CssClass = "PotencialNC"; divNa.Style.Add("display", "none"); divNc.Style.Add("display", "block"); divPromedio.Style.Add("display", "none"); divColor.Style.Add("background-color", "gray"); } else if (celda.ParentRowIndexes[2].ToString() == "Total de elementos en común:") { divNa.Style.Add("display", "none"); divNc.Style.Add("display", "none"); divPromedio.Style.Add("display", "block"); divPromedio.Style.Add(" font-weight", "bold"); divColor.Style.Add("background-color", "white"); } else { vNoValorCompetencia = Convert.ToInt32((decimal)e.Cell.DataItem); if (vNoValorCompetencia == 0) { //e.Cell.CssClass = "PotencialPuestoBajo"; this.rtmInfoEmpleados.TargetControls.Add(celda.ClientID, oListaEmpleados[celda.ColumnIndex], true); divNa.Style.Add("display", "none"); divNc.Style.Add("display", "none"); divPromedio.Style.Add("display", "none"); divColor.Style.Add("background-color", "red"); } else if (vNoValorCompetencia == 1) { //e.Cell.CssClass = "PotencialPuestoAlto"; divNa.Style.Add("display", "none"); divNc.Style.Add("display", "none"); divPromedio.Style.Add("display", "none"); divColor.Style.Add("background-color", "green"); this.rtmInfoEmpleados.TargetControls.Add(celda.ClientID, oListaEmpleados[celda.ColumnIndex], true); } else if (vNoValorCompetencia < 70) { //e.Cell.CssClass = "PotencialBajo"; divNa.Style.Add("display", "none"); divNc.Style.Add("display", "none"); divPromedio.Style.Add("display", "block"); divColor.Style.Add("background-color", "red"); } else if (vNoValorCompetencia >= 70 & vNoValorCompetencia <= 90) { //e.Cell.CssClass = "PotencialIntermedio"; divNa.Style.Add("display", "none"); divNc.Style.Add("display", "none"); divPromedio.Style.Add("display", "block"); divColor.Style.Add("background-color", "gold"); } else if (vNoValorCompetencia > 90) { //e.Cell.CssClass = "PotencialAlto"; divNa.Style.Add("display", "none"); divNc.Style.Add("display", "none"); divPromedio.Style.Add("display", "block"); divColor.Style.Add("background-color", "green"); } } } else { divNa.Style.Add("display", "none"); divNc.Style.Add("display", "block"); divPromedio.Style.Add("display", "none"); divColor.Style.Add("background-color", "gray"); } } } }