I have a grid with multiple bands.
One of the bands has more than 10 rows but I can sum them in order to just have 2 rows (because the 10 rows or more are just of 2 types TAX or OTHER:
Type Col Desc Column Amoun Column
TAX SERVICE TAX $80TAX SERVICE TAX $91TAX SERVICE TAX $102.....OTHER OTHER ITEM -$37OTHER OTHER ITEM $85....
So I want to have just 2 rows but with the corresponding sum of the amount column.
How can I do that in a specific band of the grid? I just want to have:
TAX SERVICE TAX $sum of taxesOTHER OTHER ITEM $sum of others
Hope someone can help me!!
Thanks,
Alejandro
Hi Alejandro,
I think you could acheive what you want using the OutlookGroupBy feature of the grid. You would simply group the grid by the "Type Col" column and this would create a sort've artificial hierarchy with two rows at the root level and then each parent row would have the "real" data rows as it's child rows.
To do this in code, you would do something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; // Enabled OutlookGroupBy layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; // Hide the GroupByBox so the user cannot change the groupings. layout.GroupByBox.Hidden = false; // Group by the Type Col column. layout.Bands[0].SortedColumns.Add("Type Col", false, true); }
Thanks Mike but that works for the hole grid, I just want to make the Outlookgroupby just in 1 of the bands, the other i want to keep it they way they are.
Appreciate your support and hope you can guide me.