Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2387
Group by for versioning
posted

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

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    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.

Children