Hey together.
I work with advanced databinding using the NeedDataSource event and want to add some aggregations to the footer.
After setting the DataSource I do some changes/formatting to the data in the OnDataBound event.
In this case I iterate through the MasterTableView.AutoGeneratedColumns and want to add Aggregations to all decimal Columns:
if (dataColumn.DataType == typeof(decimal)){ ((GridNumericColumn)dataColumn).Aggregate = GridAggregateFunction.Sum; ((GridNumericColumn)dataColumn).FooterText = string.Empty; ((GridNumericColumn)dataColumn).FooterAggregateFormatString = "{0}";}
My problem is, that this only works after a Postback or Rebind but not on the first load. I press refresh or do some sorting on the table and the sum shows up in the footer.
But Rebinding in this event is not possible, so what can I do to see my aggregations on first load? Is there a better event than OnDataBound?