private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
if( e.Column.FieldName.IndexOf("QTY")>-)
{
int total= ;
object val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH1QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH2QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH3QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH4QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH5QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH6QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH7QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH8QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH9QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH10QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH11QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val);
val = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns["MONTH12QTY"]);
total += val == DBNull.Value ? :Convert.ToInt32(val); gridView1.SetRowCellValue(e.RowHandle,gridView1.Columns["SUM"], total);
}
}