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
830
column sum
posted

Good evening.
how do I display the sum of a column in a XDataGrid?

Thank you.

Parents
No Data
Reply
  • 830
    posted

    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.

Children