I think you're supposed to set the value using
e.Value = ...;
instead of using
SetRowCellValue
. I would imagine
SetRowCellValue
would trigger the databind again, which calls
calfun
creating infinite recursion. Can't be sure unless I'd see the complete stack trace. But try using
e.Value
instead.
See also the sample at the documentation[
^]:
private void gridView1_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e) {
GridView view = sender as GridView;
if (e.Column.FieldName == "Total" && e.IsGetData)
e.Value = getTotalValue(view, e.ListSourceRowIndex);
}