Hi,
I'm currently upgrading UltraWebGrid to WHDG and came across an issue where I need to do sum for a certain column in the grouped rows and show it in the group row summary.
There are functions for [avg], [sum], [min], [max] (either for the grouped column or another column provided by a certain key) for UltraWebGrid, I could not find the same function for WHDG's GroupedRowTextMask.
Is this something I have to do manually or already supported in newer version?
If it's still not supported, I would suggest the functions to be added in future version since it's really helpful.
I'm still on v11.1 and will change to 13.2 after all legacy controls are upgraded.
Thanks,
Charles
Hello Charles,
Currently the GroupedRowTextMask provides the following tokens:
{0} - header of the grouped column, {1} - grouped value, {2} - number of grouped child rows, {3} - number of all data records in the group.
If you need to display some summaries instead of these values you have to create your own custom implementation since this is not provided out of the box. Howevr you can log this as a Product Idea at http://ideas.infragistics.com, the Product Ideas site allows you to suggest new product features, new functionalities in existing products and controls, and even request new controls and products altogether. Members of the Infragistics Community then vote for the features and suggestions they want to see added to the products, resulting in the most popular features bubbling up to the top. When planning new releases, our Product Management team will look at the most popular features and use your feedback to prioritize upcoming work.
* * *
Steps to create your idea:
1. Log into the Infragistics Product Ideas site at http://ideas.infragistics.com (creating a new login if needed).2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)3. Add your product idea and be sure to be specific and provide as much detail as possible. Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
The benefits of submitting the product idea yourself include:
- Direct communication with our product management team regarding your product idea.- Notifications whenever new information regarding your idea becomes available.
Additional benefits of the product idea system include:- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.- Allow you to shape the future of our products by requesting new controls and products altogether.- You and other developers can discuss existing product ideas with members of our Product Management team.
The product ideas site allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Hi Hristo,
Thanks for the quick response. I will submit the idea.
I've tried implementing custom grouping, unfortunately it seems only working for 1st level of grouping.
If I tried to access the 2nd level group or deeper, I get the group row text exactly like what I wanted but it does not show any row data.
Would you please advise if there's anything wrong with the code below?
protected void SetGroupText(GroupedRecord groupedRow) { decimal valTotal = 0; int valRowCount = 0; groupedRow.Rows.Reset(); while (groupedRow.Rows.MoveNext()) { ContainerGridRecord row = (ContainerGridRecord)groupedRow.Rows.Current; WHDGListNode node = row.DataItem as WHDGListNode; TransactionInfo info = (TransactionInfo)node.Item; valTotal += info.Amount; valRowCount++; if (groupedRow.ChildGroupRows.Count > 0) { foreach (GroupedRecord groupedChildRow in groupedRow.ChildGroupRows) { SetGroupText(groupedChildRow); } } } string colName = uiTransactionsGrid.Columns[groupedRow.ColumnGroupedBy.Key].Header.Text; groupedRow.Text = colName + " : " + groupedRow.Value.ToString() + " Count: " + valRowCount.ToString() + " Total: " + valTotal; } protected void uiTransactionsGrid_GroupedRowInitialized(object sender, GroupedRowEventArgs e) { ContainerGrid grid = sender as ContainerGrid; foreach (GroupedRecord groupedRow in grid.GroupedRows) { SetGroupText(groupedRow); } }
Basically whenever I try to access "groupedRow.ChildGroupRows" in SetGroupText method, the grid will only show grouped row headers without any row data.
If I remove any reference accessing "groupedRow.ChildGroupRows", it works fine but the 2nd level group header text is not as expected (it uses the format defined in GroupedRowTextMask instead).