I was wondering if you have any feature/examples for displaying data in the form of SQL Group by Data. I see the Outlook group by feature but that is introducting bands and shows up the child rows. In my case, I was looking something similar where we dont have child rows, except they are either Max,AVG,SUM functions on these child columns. This will result in only one row for each group by column value.
I have gone through most of the examples, even one where we customize the band to show the totals. This has not satisfied my client , as he wanted to replicate the SQL functionality
For Example: The initial data looks like the attachment (Top portion of the image) and once I group by the Supplier and I wish to see the data in the child rows as in the bottom portion of the image.
Any help would be greatly appreciated.
I'm using Infragistics2.Win.v11.1 version
Hi,
No, there's nothing like this in the WinGrid. You'd have to modify the data source, rather than the display. Maybe loop through your existing data source and build an UltraDataSource or a DataTable with the grouped data you want, and then bind that to the grid.
Just stuck at one place, while I was implementing your suggestion. Since I want to keep the drag-drop feature of UltraGrid Group by feature to the UltraGridGroup Box, I'm stumbling at the below places. Attached is an example, that I'm trying to work on.
.
1.) How to find out what columns are being dragged on to the Group Box? Tried listening to event "ultraGrid1_BeforeGroupPosChanged", but this one is not hitting when I move the columns from Grid to GroupBy Box. In the attached example, I have hardcoded one of the Column for the grouping the DataTable, since I couldnt figure out the Columns that are being grouped.
2.) Say if I have build the datasource based on the columns grouped on, but which event should I be using to assign the DataSource. I tried ultraGrid1_InitializeGroupByRow, but that has its own problems.
Grouping is tightly tied to sorting. So to detect when a column is grouped, you can handle the Before/AfterSortChange event. The event args gives you the SortedColumns collection and each column in the collection has an IsGroupBy property so you can determine which columns are grouped.
I'm not sure I understand exactly what you want to do, though. I thought you wanted to group the data in a custom way, but now it sounds like you still want to use the grid's Grouping. Are you just trying to use the grid's Grouping UI and then do your own grouping? I'm not sure that will work. Once you set the grid's DataSource, any grouping in the grid will get blown away and the grid will end up displaying your data in whatever structure you give it. So the GroupByBox will get cleared at that point.
Yes, I like the way UltraGrid UI feature for GroupByBox and want to extend that to my custom grouping scenario. But looks like as you have mentioned, once I change the Grid's Data Source, the Grouping will go away. Thanks for confirming this. I will try to implement my custom logic to simulate the UI and implement my custom grouping.
The grid has several features that support what we call an "external" mode. The idea is that the grid lets you use the UI to perform certain operations but doesn't actually perform those operations and lets you do it. This is available for Sorting, summaries, and filtering, but not grouping. So you might want to Submit a Feature Request for external grouping. And perhaps this can be added to the grid in a future release.