private void BandedGridView1_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e) {
if (e.Column.FieldName == "TotalQtyProcess") {
RepositoryItemProgressBar rp = new RepositoryItemProgressBar();
rp.ProgressViewStyle = DevExpress.XtraEditors.Controls.ProgressViewStyle.Solid;
rp.ShowTitle = true;
//rp.PercentView = true;
//rp.DisplayFormat.FormatType = FormatType.Numeric;
//rp.DisplayFormat.FormatString = "n4";
rp.Minimum = 0;
object realCutNumObj = this.bandedGridView1.GetRowCellValue(e.RowHandle, bandedGridView1.Columns["RealCutNum"]);
object totalQtyObj = this.bandedGridView1.GetRowCellValue(e.RowHandle, bandedGridView1.Columns["TotalQty"]);
int realCutNum = realCutNumObj == DBNull.Value ? 0 : Convert.ToInt32(realCutNumObj);
int totalQty = totalQtyObj == DBNull.Value ? 0 : Convert.ToInt32(totalQtyObj);
rp.Maximum = realCutNum;
if (totalQty > realCutNum) {
rp.StartColor = Color.Red;
rp.EndColor = Color.Red;
}
e.RepositoryItem = rp;
} else if (e.Column.FieldName == "TodayQtyProcess") {
RepositoryItemProgressBar rp = new RepositoryItemProgressBar();
rp.ProgressViewStyle = DevExpress.XtraEditors.Controls.ProgressViewStyle.Solid;
rp.ShowTitle = true;
rp.Minimum = 0;
object qtyTargetObj = this.bandedGridView1.GetRowCellValue(e.RowHandle, bandedGridView1.Columns["TodayQtyTarget"]);
object todayQtyObj = this.bandedGridView1.GetRowCellValue(e.RowHandle, bandedGridView1.Columns["TodayQty"]);
int qtyTarget = qtyTargetObj == DBNull.Value ? 0 : Convert.ToInt32(qtyTargetObj);
int todayQty = todayQtyObj == DBNull.Value ? 0 : Convert.ToInt32(todayQtyObj);
rp.Maximum = qtyTarget;
if (todayQty > qtyTarget) {
rp.StartColor = Color.Green;
rp.EndColor = Color.Green;
}
e.RepositoryItem = rp;
}
}