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
570
UltraGrid-Hide Parent Band Headers/Display Child Band
posted

I'm trying to mimic the behavior show in the attached file. In the main grid I have a parent band (Order type) and the child band consists of the actual orders. Note that the grid displays the child band column headers and hides the parent band col headers. I don't have any issues hiding the parent bands header, but I'm not sure how to make the child band headers always visible at the top of the grid. Has anyone doen something similar? perhaps the parent-child band model is not suitable for this? I'm open to suggestions.

Thanks,

Sean

  • 469350
    Verified Answer
    Offline posted

    Hi Sean,

    I don't think you can do this with a hierarchical data source that has two bands. It seems to me that what you need here is to use the OutlookGroupBy feature of the grid.

    What you could do is bind the grid directly to the orders table (not the Order type). Then you can use OutlookGroupBy to group the grid's only band by OrderType, thus creating the hierarchy you want. Then all you have to do is set HeaderPlacement (on the Override) to FixedOnTop to get the headers displayed once at the top of the grid.

    So it would look something like this:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                e.Layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy;
                e.Layout.Bands[0].SortedColumns.Add(band.Columns["Order type"], false, true);

                e.Layout.Override.HeaderPlacement = HeaderPlacement.FixedOnTop;      
            }