在dev的grid 中,Summaryitem的DisplayFormat
如果将这个统计列的结果加以运算?
我只看到DisplayFormat={0},比如我想在这个结果上加800,如何做?
------解决方案--------------------
RunDesign->Columns->SummaryItem->SummaryType:Custom
在GridView的CustomSummaryCalculate事件中自定义计算。
if (e.IsTotalSummary && e.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Finalize)
{
GridView view = sender as GridView;
if (e.Item == view.Columns["Id"].SummaryItem)
{
int count = 0;
for (int i = 0; i < view.DataRowCount; i++)
{
object temp = view.GetRowCellValue(e.RowHandle, "Id");
temp = (temp == DBNull.Value
------解决方案--------------------
temp == null) ? 0 : temp;
count += Convert.ToInt32(temp);
}
e.TotalValue = count + 200;
}
}