/// <summary> /// برای فیلتر کردن پایوت گیرید بر اساس هر سطح از این متد استفاده می گردد /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="PivotGridCellDataBoundEventArgs"/> instance containing the event data.</param> protected void RadPivotGrid2_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e) { if (e.Cell is PivotGridDataCell) { if (e.Cell.Text == " ") { e.Cell.Text = "0"; } } }
void RadPivotGrid1_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e) { PivotGridDataCell cell = e.Cell as PivotGridDataCell; if (cell != null) { // If this is the first data cell we need to populate the collecion which fake columns cells count if (isFirstDataCell) { PopulateFakeColumnsCellCollection(cell); isFirstDataCell = false; } // We do not need to attach onclick event on cell which does not have values if (cell.DataItem != null) { string argument = GetCommandArguments(cell); string script = string.Format("OpenDetailsWindow('{0}')", argument); cell.Attributes.Add("onclick", script); } index++; } }
void RadPivotGrid1_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e) { PivotGridDataCell cell = e.Cell as PivotGridDataCell; if (cell != null) { // If this is the first data cell we need to populate the collecion which fake columns cells count if (isFirstDataCell) { PopulateFakeColumnsCellCollection(cell); isFirstDataCell = false; } // We do not need to attach onclick event on cell which does not have values if (cell.DataItem != null) { string argument = GetCommandArguments(cell); string script = string.Format("OpenDetailsWindow('{0}')", argument); cell.Attributes.Add("onclick", script); } index++; } }
protected void rgEvaluacionesTransversalesporPersonal_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e) { int porcentaje; string valor_desarrolladas = string.Empty; obtenervalor(valor_desarrolladas); int parametroCompetenciasDesarrolladas = BE_EVALUACIONES_COMPETENCIAS_TRANSVERSALES.VALOR; if (e.Cell is PivotGridDataCell) { PivotGridDataCell cell = e.Cell as PivotGridDataCell; if (cell.CellType == PivotGridDataCellType.DataCell) { if (cell != null) { switch ((cell.Field as PivotGridAggregateField).DataField) { //color the cells showing totals for TotalPrice based on their value case "PORCENTAJE": if (cell.DataItem != null && cell.DataItem.ToString().Length > 0) { decimal price = Convert.ToDecimal(cell.DataItem); porcentaje = Convert.ToInt32(price * 100); if (porcentaje >= parametroCompetenciasDesarrolladas) { string valor = string.Empty; obtenerColorVerde(valor); string color = BE_EVALUACIONES_COMPETENCIAS_TRANSVERSALES.VALOR_COLOR; cell.BackColor = ColorTranslator.FromHtml(color); } else if (porcentaje < parametroCompetenciasDesarrolladas) { string valor = string.Empty; obtenerColorAmarillo(valor); string color = BE_EVALUACIONES_COMPETENCIAS_TRANSVERSALES.VALOR_COLOR; cell.BackColor = ColorTranslator.FromHtml(color); } } break; } } } } }