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
350
How change the default count operation on GroupBy
posted

Regards,

When I apply a grouping operation by code like this:

Me.MainGrid.DisplayLayout.Bands (0). SortedColumns.Add ("ID", False, True)

The default operation for the group is a counter (COUNT).

In code, may be (VB or C #). NET

Question 1:
How do I change the type of operation for the group by a sum or average, for example?

Question 2:
Is it possible to change the default title when you group by a custom?

In advance thanks for your help ....

  • 469350
    Offline posted

    Hi,

    xavendano2 said:
    Question 1:
    How do I change the type of operation for the group by a sum or average, for example?

    The count is automatic - it's not a summary or an "operation" really. Anyway, there are a couple of different ways to change the text of the GroupByRow. In this case, you will probably want to use the GroupByRowDescriptionMask property. This is basically a string with some replacement codes that allow you to determine what's displayed in each GroupByRow.

    The other way is to use the InitializeGroupByRow event on the grid and set e.Row.Description to whatever text you want.

    To add a Sum or Average or any other kind of summary to the grid, you can use the band.Summaries.Add method. Any summaries you add will, by default, show up in the GroupByRow as part of the description.

    xavendano2 said:
    Question 2:
    Is it possible to change the default title when you group by a custom?

    I'm not sure what you mean by "default title". But I guess you probably mean the text on the GroupByRow, in which case I have already answered that.