Good evening.how do I display the sum of a column in a XDataGrid?Thank you.
I write this in the xDataGrid1_Load event:
XamDataGrid xdg = sender as XamDataGrid;SummaryDefinitionCollection summaries = xdg.FieldLayouts[0].SummaryDefinitions;summaries.Clear();SummaryDefinition summary = new SummaryDefinition();summary.Calculator = SummaryCalculator.Sum;summary.SourceFieldName = "CassaUscita";summaries.Add(summary);
the first start I get this error on line SummaryDefinitionCollection summaries = xdg.FieldLayouts[0].SummaryDefinitions; :Index out of range. Required non-negative value and the size of the nomire.if I close the contentPane where you uploaded the UserControl that contains the XDataGrid and then reopen, I receive the money without any problems.XDataGrid the UserControl is in a load in a contentPane.
with that first code works well.I missed the code that loads the UserControl in ContentePane.Thank you.