After a user groups a column, then chooses columns to display, how can i "regroup" and recalculate accordingly the rows being grouped? something similar to SQL grouping
if you can see in the screenshot, what i want to know is, how to recalculate the rows, (and remove other rows) if my user removes the customer code field distinct to the non-numeric type. (in this view, this is not the only columns, there are 50+ columns, only hidden for this screenshot)
This is really the exact requirement with mine: http://es.infragistics.com/community/forums/t/72681.aspx
Hope to get the reply.
Thanks.
Hi,
I'm sorry, but I still don't understand what you want here. It looks like you want the grid to combine several rows into one row. The only way to do that is by grouping. In this case, you would have to group by two field: first by Due Date and then by Order Type.
This would result in a 3-level hierarchy in the grid - the first two level would show GroupBy Rows and the third level would be the only one that shows data rows that have cells in them.
The grid will never display a GroupByRow with normal editable data cells in it, although you could have summaries in a GroupByRow which appear aligned with the column like cells.
What you are showing here with the text in your post are data rows where the values of some cells have been combined into a single row and summed up. So this would have to be done by using a summary, or else you would have to do this on your data source and not in the grid.
hi, you're almost there.. but my concern is about the data being displayed. (i just reattached the screenshot),in my screenshot is two groups, the one .. 12/30 and the other is 12/31.. but by means of sql query, removing the customer code in the grouping statement will result like this12/30/2011order type | amount | current | 1 month | 2 monthsGA | 5,400 | 0 | 0 | 0 IS | 11965.1 | 0 | 0 | 012/31/2011order type | amount | current | 1 month | 2 monthsIS | 50,279 | 0 | 0 | 0this result is obtained by matter of sql query result..
So... you are hiding the column via the column chooser and the grid is still grouped by that column.
If the grid is grouped by a column, then by default, that column is already hidden automatically. You cannot hide it using the ColumnChooser, because the ColumnChooser will already show it as unchecked (hidden).
Assuming you changed this, but setting HiddenWhenGroupBy on the column to false, then I guess you are asking how to ungroup the column when it gets hidden by the user.
That's very easy to do:
private void ultraGrid1_AfterColPosChanged(object sender, AfterColPosChangedEventArgs e) { if (e.PosChanged == PosChanged.HiddenStateChanged) { UltraGridColumn column = e.ColumnHeaders[0].Column; if (column.Hidden && column.IsGroupByColumn) { column.Band.SortedColumns.Remove(column); } } }
sorry if this taking so long, but let me try it this way..this is actually equivalent to the screenshot's columns:select customer code, order type, due date, amount, sum(data1) as 1 month, sum(data2) as 2 monthgroup by due date, customer code, order typeand everything here is binded in the grid, no unbound columnif i take out customer code (via column chooser), my display should be the result equivalent to this query:select order type, due date, amount, sum(data1) as 1 month, sum(data2) as 2 monthgroup by due date, order type