aggregation in footer not working on first load

1 posts, 0 answers
  1. Florian
    Florian avatar
    2 posts
    Member since:
    Jun 2016

    Posted 09 Oct 2017 Link to this post

    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?

Back to Top