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
260
Grid Columns Not retaining wdith when clearing Group
posted

We've recently upgraded to the verion 10.2.20102.1004. I have a grid in which a single group is created in the gird. When this grid initially loads and is populated it displays as expected, but when the underlying data set is reset and the Group is cleared the columns are not retainging thier widths. Please note that the gird is created dynamicly at runtime. Thre were no such issues in version 3.1.20041.1044, but we're getting the anomaly since upgrading. Any ideas? Here's a sample of the code that worked in the older version, perhaps I need to do something else to retain the column widths. Unable to find anything on your site regading this sort of behavior, please advice.

 

Private Sub PopDetailGrid()
        With grdDetail
            .SuspendLayout()
            .DisplayLayout.Bands(0).Groups.Clear()
            NewgrdDetail.PopGridData(rsGLTransdata)

            If (_columWidths.Count = 0) Then
                SetDetailColumnWidths()
            End If

            With .DisplayLayout.Bands(0)

                ' Add a group with the key of G1
                .Groups.Add("G1")
                .LevelCount = 2
                .GroupHeadersVisible = False
                .Groups("G1").Columns.Add(.Columns("GLAccount"))
                .Groups("G1").Columns.Add(.Columns("GLPeriod"))
                .Groups("G1").Columns.Add(.Columns("ActivityPeriod"))
                .Groups("G1").Columns.Add(.Columns("Batch"))
                .Groups("G1").Columns.Add(.Columns("TransType"))
                .Groups("G1").Columns.Add(.Columns("TransDate"))
                .Groups("G1").Columns.Add(.Columns("TransRef"))
                .Groups("G1").Columns.Add(.Columns("Agreement"))
                .Groups("G1").Columns.Add(.Columns("Company"))
                .Groups("G1").Columns.Add(.Columns("TransAmount"))
                .Groups("G1").Columns.Add(.Columns("TransDescr"))
                .Columns("TransDescr").Level = 1
                .Override.CellAppearance.BackColor = Color.White
                .Override.RowFilterMode = RowFilterMode.AllRowsInBand
                .Columns("TransDescr").Header.Caption = ""
                Dim cCol As UltraGridColumn = .Columns("TransAmount")
                .Summaries.Clear()
                Dim sSum As SummarySettings
                sSum = .Summaries.Add("avgTransAmount", SummaryType.Average, cCol, SummaryPosition.Left)
                With sSum
                    .Appearance.BackColor = Color.LightBlue
                    .DisplayFormat = "{0:Transaction Average: $#,###.00}"
                    .SummaryPosition = SummaryPosition.Right
                    .Appearance.TextHAlign = HAlign.Right
                    .Hidden = True
                End With
                sSum = .Summaries.Add("sumTransAmount", SummaryType.Sum, cCol, SummaryPosition.Right)
                With sSum
                    .Appearance.BackColor = Color.LightBlue
                    .DisplayFormat = "{0:Transaction Total: $#,###.00}"
                    .SummaryPosition = SummaryPosition.Right
                    .Appearance.TextHAlign = HAlign.Right
                    .Hidden = True
                End With
            End With
            UpdateTotalLabel()
            SetGrid(grdDetail)
            SetGridLines(grdDetail)
            .DisplayLayout.Scrollbars = UltraWinGrid.Scrollbars.Vertical
            .ActiveRow = Nothing
            .FlatMode = True
            .BringToFront()
            .ResumeLayout()
        End With
        lblRecordCount.Text = Format(Me.grdDetail.Rows.VisibleRowCount, "#,##0") _
                            & " records visible of " & Format(Me.grdDetail.Rows.Count, "#,##0") _
                            & " records retrieved out of " & Format(rsGLTransdata.Count, "#,##0") _
                            & " records for the selected GL Periods."
    End Sub