예제 #1
0
        /// <summary>
        /// Handles invocation of GetCellStyle events
        /// </summary>
        internal void DoGetCellStyleEvent(
            GridCell gridCell, StyleType eStyle, ref CellVisualStyle style)
        {
            if (GetCellStyle != null)
            {
                GridGetCellStyleEventArgs ev = new
                    GridGetCellStyleEventArgs(gridCell.GridPanel, gridCell, eStyle, style);

                GetCellStyle(this, ev);

                style = ev.Style;
            }
        }
예제 #2
0
        private void WeeklyDataTableCellStyle(object sender, GridGetCellStyleEventArgs e)
        {
            double num;
            var nfi = new CultureInfo("en-US", false).NumberFormat;

            if (e.GridCell.Value.ToString().IndexOf("-", StringComparison.Ordinal) != -1)
                e.Style.TextColor = Color.Red;
            else
                if ((e.GridCell.Value.ToString().IndexOf(",", StringComparison.Ordinal) != -1))
                    e.Style.TextColor = Color.Green;
                else
                    if (double.TryParse(e.GridCell.Value.ToString(), NumberStyles.Float, nfi, out num))
                        e.Style.TextColor = Color.Green;
        }