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
2945
Column outside group positioned before groups
posted

Hi,

I have a grid with 4 columns.  The first column isn't inside a group.  I've set RowLayoutColumnInfo.SpanY = 4 so that it is a double-height column.

I then add a group to the grid, and set the remaining three columns to that group (RowLayoutColumnInfo.ParentGroup = MyGroup).

However, the group containing the three columns always displays before my groupless column.  I can't seem to find the right property to set to change this.  Any ideas?

Thanks,
Campbell 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Campbell,

    This is controlled by the OriginX property of the RowLayoutColumnInfo/RowLayoutGroupInfo on the column and group.


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridBand band = layout.Bands[0];

                band.RowLayoutStyle = RowLayoutStyle.GroupLayout;
                UltraGridColumn column0 = band.Columns[0];
                UltraGridColumn column1 = band.Columns[1];
                UltraGridColumn column2 = band.Columns[2];
                UltraGridColumn column3 = band.Columns[3];

                UltraGridGroup group = band.Groups.Add("Group");
                column1.RowLayoutColumnInfo.ParentGroup = group;
                column2.RowLayoutColumnInfo.ParentGroup = group;
                column3.RowLayoutColumnInfo.ParentGroup = group;

                // Column 0 should be the first column. So set it's OriginX to 0.
                column0.RowLayoutColumnInfo.OriginX = 0;

                // The group should be to the immediate right of the column, so determine the X position of the
                // right edge of the column by adding it's resolved OriginX to it's resolved SpanX.
                group.RowLayoutGroupInfo.OriginX = column0.RowLayoutColumnInfo.OriginXResolved + column0.RowLayoutColumnInfo.SpanXResolved;
            }

Reply Children
No Data