Hello,
My intention is to calculate the sum of all the values of a column, where this column was selected as a grouping column.
I'd like to show the result directly in the grouping header row.
This is the code I'm using:
In this code my intention is to calculate and show the total sum of all the items grouped by the price itself.
The problem is the result is alway zero. It seems like the GridAggregateFunction.Sum doesn't works inside the
I tryed exacly the same code using the COUNT aggregate function instead of the SUM, ad it works perfectly giving me the count of the item grouped by the price:
Thanks for any suggestions,
Alcide Burato
My intention is to calculate the sum of all the values of a column, where this column was selected as a grouping column.
I'd like to show the result directly in the grouping header row.
This is the code I'm using:
string
ColumnName =
"Price"
;
GroupDescriptor descriptor1 =
new
GroupDescriptor();
descriptor1.GroupNames.Add(ColumnName, ListSortDirection.Ascending);
string
formatStr =
"The total sum of items {0} with price equal to {1} is equal to {2}."
;
descriptor1.Format = formatStr;
descriptor1.Aggregates.Add(
"Sum('"
+ ColumnName +
"')"
);
this
.radGridView1.GroupDescriptors.Add(descriptor1);
In this code my intention is to calculate and show the total sum of all the items grouped by the price itself.
The problem is the result is alway zero. It seems like the GridAggregateFunction.Sum doesn't works inside the
GroupDescriptor
I tryed exacly the same code using the COUNT aggregate function instead of the SUM, ad it works perfectly giving me the count of the item grouped by the price:
string
ColumnName =
"Price"
;
GroupDescriptor descriptor1 =
new
GroupDescriptor();
descriptor1.GroupNames.Add(ColumnName, ListSortDirection.Ascending);
string
formatStr =
"The total sum of items {0} with price equal to {1} is equal to {2}."
;
descriptor1.Format = formatStr;
descriptor1.Aggregates.Add(
"Count('"
+ ColumnName +
"')"
);
this
.radGridView1.GroupDescriptors.Add(descriptor1);
Thanks for any suggestions,
Alcide Burato