Example #1
0
 private void View_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     if (e.Column == Column)
     {
         int percent            = Convert.ToInt16(e.CellValue);
         ProgressBarViewInfo vi = (e.Cell as GridCellInfo).ViewInfo as ProgressBarViewInfo;
         if (percent < 25)
         {
             vi.ProgressInfo.EndColor   = Color.Red;
             vi.ProgressInfo.StartColor = Color.Red;
         }
         else if (percent < 50)
         {
             vi.ProgressInfo.EndColor   = Color.Orange;
             vi.ProgressInfo.StartColor = Color.Orange;
         }
         else if (percent < 75)
         {
             vi.ProgressInfo.EndColor   = Color.YellowGreen;
             vi.ProgressInfo.StartColor = Color.YellowGreen;
         }
         else if (percent <= 100)
         {
             vi.ProgressInfo.EndColor   = Color.Green;
             vi.ProgressInfo.StartColor = Color.Green;
         }
     }
 }
 public MyProgressBarCalculator(ProgressBarViewInfo info)
 {
     _ViewInfo = info;
     CalcCenter();
 }