Hello,
I'm having trouble with this.
I have a grid that is grouped by date.
I have a column with aggregate marked as sum. This column holds a number in seconds, which I convert to minutes for display during the ItemDataBound Event.
Now in the footer it will sum the values and display as seconds, but I need to show it in minutes. I tried to get at this value in the ItemDataBound event but it seems to grab the value of the final row before the sum calculation on the grouping is performed.
I'm having trouble with this.
I have a grid that is grouped by date.
I have a column with aggregate marked as sum. This column holds a number in seconds, which I convert to minutes for display during the ItemDataBound Event.
Now in the footer it will sum the values and display as seconds, but I need to show it in minutes. I tried to get at this value in the ItemDataBound event but it seems to grab the value of the final row before the sum calculation on the grouping is performed.
if (e.Item is GridGroupFooterItem)
{
GridGroupFooterItem item = (GridGroupFooterItem)e.Item;
DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
foreach (DataColumn column in groupDataRow.DataView.Table.Columns)
//Check the condition and add only the field you need
if (column.ColumnName == "Stop Idle")
{
double si = double.Parse(groupDataRow["Stop Idle"].ToString());
item.Cells[column.Ordinal].Text = (si / 60).ToString();
}
}