This is a migrated thread and some comments may be shown as answers.
aggregation in footer not working on first load
0 Answers 3 Views
This is a migrated thread and some comments may be shown as answers.
Florian
Top achievements
Rank 1
Florian asked on 09 Oct 2017, 01:39 PM

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?

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Florian
Top achievements
Rank 1
Share this question
or