private void gridView1_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
{
if (((DevExpress.XtraGrid.GridSummaryItem)e.Item).FieldName.
CompareTo("z") == 0)
{
double totalMarks = Convert.ToDouble(gridColumn1.SummaryItem.SummaryValue);
double marksObtained = Convert.ToDouble(gridColumn2.SummaryItem.SummaryValue);
if (totalMarks != 0)
{
e.TotalValue = marksObtained / totalMarks;
}
else
{
e.TotalValue = 0;
}
}
}