Пример #1
0
        public void SetCompletedColor(DataGridViewCellFormattingEventArgs args)
        {
            GreigeRoll roll = (GreigeRoll)this.grdGreigeRoll.Rows[args.RowIndex].DataBoundItem;

            (args.CellStyle.ForeColor, args.CellStyle.BackColor) =
                roll.IsComplete ? CellColor.GetIsCompletedColorColor() : this.defaultCellColor;
        }
Пример #2
0
 private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         GreigeRoll roll = this.sewinQueue.Rolls[e.RowIndex];
         if (e.ColumnIndex == this.colMeasuredLength.Index)
         {
             if (e.RowIndex < this.logic.CurrentRollIndex)
             {
                 (e.CellStyle.ForeColor, e.CellStyle.BackColor) =
                     roll.RollLength == 0 ?
                     new CellColor {
                     ForeColor = this.dataGridView1.DefaultCellStyle.ForeColor, BackColor = this.dataGridView1.DefaultCellStyle.BackColor
                 } :
                 CellColor.GetFeetColor(roll.RollLength, (long)e.Value, this.serviceSettings);
             }
         }
         else if (roll.IsComplete)
         {
             (e.CellStyle.ForeColor, e.CellStyle.BackColor) = CellColor.GetIsCompletedColorColor();
         }
     }
 }