Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
945
Remove SummaryDefinition if it only contains one group
posted

I am loading a large datasource into a XamDataGrid and in the FieldLayoutInitialized event handler I'm defining some SummaryDefinition based on Property Attributes.

foreach (var columnDetailsAttribute in attributes.Where(attribute => attribute.TotalsBy || attribute.AverageBy))
{
    var summaryDefinition = new SummaryDefinition();
    summaryDefinition.SourceFieldName = columnDetailsAttribute.PropertyName;
   
    summaryDefinition.Calculator = columnDetailsAttribute.TotalsBy
        ? (SummaryCalculator) Infragistics.Windows.DataPresenter.SummaryCalculator.Sum
        : Infragistics.Windows.DataPresenter.SummaryCalculator.Average;
   
    e.FieldLayout.SummaryDefinitions.Add(summaryDefinition);
}

this works fine.

However I would like to turnoff or not define the SummaryDefinition if the grouping only has one group.

Parents Reply Children
No Data