private void grdDetalleQuincena_InitializeLayout(object sender, InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; e.Layout.Override.AllowUpdate = DefaultableBoolean.False; e.Layout.Override.HeaderClickAction = HeaderClickAction.Select; WindowsFormsUtil.SetUltraColumnFormat(band.Columns["fiscal"], WindowsFormsUtil.TextMaskFormatEnum.Integer); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["factura"], WindowsFormsUtil.TextMaskFormatEnum.Integer); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["factura_original"], WindowsFormsUtil.TextMaskFormatEnum.Integer); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["importe"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["costo"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["utilidad"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["utilidad_comisionable"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["margen_utilidad"], WindowsFormsUtil.TextMaskFormatEnum.Percentage); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["total_acumulado"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["acumulado_cuota"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["acumulado_comision"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["acumulado_comision_agente"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["total"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["total_pagado"], WindowsFormsUtil.TextMaskFormatEnum.Currency); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["porcentaje_comision"], WindowsFormsUtil.TextMaskFormatEnum.Percentage); WindowsFormsUtil.SetUltraColumnFormat(band.Columns["cuota"], WindowsFormsUtil.TextMaskFormatEnum.Currency); Parallel.ForEach(this.grdDetalleQuincena.Rows, row => { if (row.Cells["pendiente_pago"].Value.ToString() == "Si") { row.CellAppearance.BackColor = Color.LightGreen; } decimal utilidad = Convert.ToDecimal(row.Cells["utilidad_comisionable"].Value); decimal utilidadComissionable = Convert.ToDecimal(row.Cells["utilidad_comisionable"].Value); if (utilidad - utilidadComissionable > 0.01M || utilidadComissionable <= 0) { if (row.CellAppearance.BackColor == Color.LightGreen) { row.CellAppearance.BackColor = Color.YellowGreen; } else { row.CellAppearance.BackColor = Color.Yellow; } } }); }