I wish to sum up all credits that I have already filtered in a grid. I have written this code as shown below:-
DevExpress.XtraGrid.Columns.GridColumn col = View.Columns.ColumnByFieldName("Credit");
if (col == null)return;
View.BeginSort();
try
{
int dataRowCount = View.DataRowCount;
for (int i = 0; i < dataRowCount; i++)
{
object cellValue = View.GetRowCellValue(i, col);
decimal totalcredit = Convert.ToDecimal(cellValue);
barEditItemCredit.EditValue += totalcredit;
}
}finally{
View.EndSort();
}
when I run the program, I get the below exception.
Please assist.