C1flexgrid - subtotals lost when sorting

Posted by: galvarez on 2 November 2023, 11:48 am EST

  • Posted 2 November 2023, 11:48 am EST

    Hello!

    I am creating subtotals in C1FlexGrid with this instruction Grd.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, -1, Grd.Cols[“DictationTime”].Index,“Total”)

    It works fine, but when I sort by clicking on any column in the list, the column is sorted but the subtotal is lost.

    what am I doing wrong?

    Thank you so much!

  • Posted 3 November 2023, 6:10 am EST

    Hello Gustavo,

    When we sort in Bounded FlexGrid, the applied subtotals are lost, as in bound mode FlexGrid is not able to apply subtotals automatically, so you have to apply them manually in AfterSort evet as follows:

    void ApplySubTotal()
    {
        c1FlexGrid1.Subtotal(AggregateEnum.Sum, 0, 0, c1FlexGrid1.Cols["Price"].Index, "Total {0}");
    
        c1FlexGrid1.AutoSizeCols();
    }

    Please refer to the attached sample for implementation.

    FlexGrid60_SubTotal.zip

    If you are doing something different from our understanding, please share your approach with us so that we can assist you accordingly.

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels