The problem I am trying to solve is to display a list of entities in a UltraGrid that can/might be versioned. The dataset will have 1 or more rows per item name. What I would like to do is group by the item name and display a normal looking grid. IFF there is more than one item, then present the + expander to the left for that row. When the + expander is clicked, the other items would be displayed under the current version.
Is this possible with the UltraGrid? If so, how would I implement it?
scarleton
Hi Scarleton,
It sounds to me like you want to use OutlookGroupBy and group your rows by the ItemName. What you would do is something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand rootBand = layout.Bands[0]; UltraGridOverride ov = layout.Override; // Set the ViewStyleBand to allow grouping. e.Layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; // Group by the column e.Layout.Bands[0].SortedColumns.Add("Int32 1", false, true); // If you don't want the users to be able to change the grouping, you would hide the // GroupByBox e.Layout.GroupByBox.Hidden = true; }
The last line here about hiding the GroupByBox is optional.
Mike,We have the same requirement (grouping data by columns). I have an UltraWinGrid bound to a flat DataSet, with the ViewStyleBand on the layout set to 'OutlookGroupBy'. Then when I run the app I drag a column to the GroupBy box. We are trying to make each subsequent level appear as just another row in the grid (although indented and with the lines and expansion indicators). Additionally, each parent row is a summary of all the rows below it. Thus what we would end up with is something like a treetable.I am attaching a screen shot of what we are trying to get it to look like. I know what we are trying to do is possible because the screen shot is of an application that was built using Infragistics UltraWinGrid. So my question is, is the 'OutlookGroupBy' the way to achieve this? Or should we be looking at another method in the UltraWinGrid? I realize this inquiry is sort of nebulous but I've been hacking at this for several days now with no clear answer.
Thank you in advance!