private void TdgMacro_FormatText(object sender, FormatTextEventArgs e) { for (int x = 3; x < Ds.Tables["DtPlanProduccionMAI"].Columns.Count; x++) { if (e.Column.DataField.ToString() == Ds.Tables["DtPlanProduccionMAI"].Columns[x].ColumnName) { if (e.Value.ToString().Trim() != "") { e.Value = string.Format("{0:0.00}", Convert.ToDecimal(e.Value)); } } } }
private void tdbgKardex_FormatText(object sender, FormatTextEventArgs e) { switch (e.Column.DataField.ToString()) { case "Entrada": if (e.Value.ToString().Trim() != "") { e.Value = string.Format("{0:0.00}", Convert.ToDecimal(e.Value)); } break; case "Salida": if (e.Value.ToString().Trim() != "") { e.Value = string.Format("{0:0.00}", Convert.ToDecimal(e.Value)); } break; } }