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
75
Grouped and ungrouped column order in Grid
posted

Hello,

I have an ultragrid with 3 columns:

I'm trying to create, with groups, the following;

but when i try to do it:

    Private Sub UltraGrid1_InitializeLayout(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        With e.Layout
            .GroupByBox.Hidden = True
            With .Bands(0)
                .RowLayoutStyle = RowLayoutStyle.GroupLayout

                .Columns("col1").RowLayoutColumnInfo.SpanY = 4

                Dim mGroup As UltraGridGroup = .Groups.Add("G1", "Group 1")
                .Columns("Col2").RowLayoutColumnInfo.ParentGroup = mGroup
                .Columns("col3").RowLayoutColumnInfo.ParentGroup = mGroup
            End With
        End With
    End Sub

I get:

The result is not in the desired order, and i cannot reorder it...

I found a workaround:

    Private Sub UltraGrid1_InitializeLayout(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        With e.Layout
            .GroupByBox.Hidden = True
            With .Bands(0)
                .RowLayoutStyle = RowLayoutStyle.GroupLayout

                Dim mBogusGroup As UltraGridGroup = .Groups.Add("BG", "")
                mBogusGroup.RowLayoutGroupInfo.LabelPosition = LabelPosition.None
                With .Columns("col1")
                    .RowLayoutColumnInfo.ParentGroup = mBogusGroup
                    .RowLayoutColumnInfo.SpanY = 4
                End With

                Dim mGroup As UltraGridGroup = .Groups.Add("G1", "Group 1")
                .Columns("Col2").RowLayoutColumnInfo.ParentGroup = mGroup
                .Columns("col3").RowLayoutColumnInfo.ParentGroup = mGroup
            End With
        End With
    End Sub

But for every column i have i need to ensure that it has a group column.

Is there a simpler/better way?