Hi,
I have a table in the database which needs to be displayed on the grid. If I need a group by and a summary row feature together on the data, its possible with XamGrid. However when a column is grouped by, it appears as a single row and user would have to expand to view the child rows.
I was wondering if I can have them view in hierarchical instead. For ex> A Sum(B) Sum(C) A B1 C1 A B2 C2> A Sum(B) Sum(C) A B1 C1 A B2 C2
Is this possible??
Yes, its possible, however we don't currently offer as an inbox feature the ability to show summaries, although it is something we are looking into.
For now though, you can actually achieve this yourself, by using the Column's GroupByItemTemplate property. The DataContext for the Template, provides you with all the information you'll need to calculate the sums for each GroupByRow.
We actually have a very good article that shows something similar:
http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=SL_xamGrid_Custom_GroupBy_Row_Display.html
Hope this helps,
-SteveZ
Hi Steve,
GroupByItemTemplate might not be the best solution for me as I need aggregated sum for each column to be displayed at parent level and have child rows displayed below that.
I came across this link which talks about TemplateColumnLayout. This potentially can be the solution. I am planning to display the aggregated sum values as data on the grid (with select sum(a), sum (b)... ) and when clicked on the arrow, I plan to make a async call and display the child rows(please suggest if there is a better solution). Although I am not sure which event gets triggers on clicking the arrow. Can you please help me with it?
I'm really not sure what you're trying to do.
If you want custom data to be displayed in the GroupBy row, then the GroupByItemTemplate is really your only option.
I'm confused because you said the TemplateColumnLayout would work for you, and thats completely unrelated to GroupBy. So i'm not really sure how that would help you in your situation.
But i supposed if your data is already in a collection thats grouped, it would work...
Anyways, to answer your question, the RowExpansionChanging/ed fires when you click the arrow.
However, i don't think thats what you should be listening for, b/c of virtualization. Instead, you should hook up the Loaded event to an element in the DataTemplate of TemplateColumnLayout. Then react to it as necessary
You can read more about the TemplateColumnLayout here:
http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=xamGrid_Template_Column_Layout.html
-SteveZ.
Any updates on this issue? I would appreciate if you could provide me with sample code to get this working.
Thanks,Harish