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
1706
UltraGrid v12.1 CardView mode - prevent label resizing
posted

I am using the UltraGrid Control in CardView mode with RowLayoutStyle set to ColumnLayout, and CardSettings.Style set to StandardLabels
I am formatting the card to have multiple rows and columns in one datarow as I see it to best fit the data.
I have been trying to have the grid auto-resize the cells without resizing the labels (headers) but have had no success.
I even looked into the source to try to see how to accomplish this and have not yet found a way to do this.
I did try to handle the resizing manually, but it ended up even worse.

Is there anything I can do to prevent this from occurring.  Note that I would prefer to allow the user to resize the labels in case their system's DPI ratio is non-standard.

This is the setup code I am using:

    With HeaderGrid.DisplayLayout
        With .Override
            .HeaderStyle = Infragistics.Win.HeaderStyle.Standard
            .ColumnSizingArea = Infragistics.Win.UltraWinGrid.ColumnSizingArea.CellsOnly
            .CardSpacing = 0

            With .HeaderAppearance
                .BackColor = Drawing.SystemColors.Control
                .BorderColor = Drawing.SystemColors.ControlLightLight
                .ResetAlphaLevel()
                .ResetBackColorAlpha()
                .ResetBackColor2()
                .TextHAlign = Infragistics.Win.HAlign.Right
            End With

            .CardAreaAppearance.BorderColor = Drawing.SystemColors.Control
        End With

        With .Bands(0)
            With .CardSettings
                .CardScrollbars = Infragistics.Win.UltraWinGrid.CardScrollbars.None
                .ShowCaption = False
                .Style = Infragistics.Win.UltraWinGrid.CardStyle.StandardLabels
                .AllowSizing = True
                .AutoFit = True
            End With

            .CardView = True
            .RowLayoutStyle = Infragistics.Win.UltraWinGrid.RowLayoutStyle.ColumnLayout

            With .Columns("Customer")
                .Header.Appearance.ResetTextHAlign()
                With .RowLayoutColumnInfo
                    .OriginX = 0
                    .OriginY = 0
                    .PreferredLabelSize = New System.Drawing.Size(62, 0)
                    .MinimumLabelSize = New System.Drawing.Size(62, 0)
                    .SpanX = 7
                    .SpanY = 2
                End With
            End With

            With .Columns("Processed By")
                .Header.Appearance.ResetTextHAlign()
                With .RowLayoutColumnInfo
                    .OriginX = 7
                    .OriginY = 0
                    .PreferredLabelSize = New System.Drawing.Size(70, 0)
                    .MinimumLabelSize = New System.Drawing.Size(70, 0)
                    .SpanX = 2
                    .SpanY = 2
                End With
            End With

            With .Columns("Contract No")
                .Header.Appearance.ResetTextHAlign()
                With .RowLayoutColumnInfo
                    .OriginX = 0
                    .OriginY = 2
                    .PreferredLabelSize = New System.Drawing.Size(1, 0)
                    .SpanX = 2
                    .SpanY = 2
                End With
            End With

            With .Columns("Order No")
                .Header.Appearance.ResetTextHAlign()
                With .RowLayoutColumnInfo
                    .OriginX = 5
                    .OriginY = 2
                    .PreferredLabelSize = New System.Drawing.Size(50, 0)
                    .MinimumLabelSize = New System.Drawing.Size(50, 0)
                    .SpanX = 2
                    .SpanY = 2
                End With
            End With

            With .Columns("Design Status")
                .Header.Appearance.ResetTextHAlign()
                With .RowLayoutColumnInfo
                    .OriginX = 7
                    .OriginY = 2
                    .PreferredLabelSize = New System.Drawing.Size(1, 0)
                    .SpanX = 2
                    .SpanY = 2
                End With
            End With

            With .Columns("Notes")
                .Header.Appearance.ResetTextHAlign()
                With .RowLayoutColumnInfo
                    .OriginX = 0
                    .OriginY = 4
                    .PreferredLabelSize = New System.Drawing.Size(1, 0)
                    .SpanX = 9
                    .SpanY = 2
                End With
            End With
        End With
    End With

(Note that I set the PreferredLabelSize to System.Drawing.Size(1, 0) to prevent it from affecting the base size I specify in a previous datacolumn that is in the same physical col)

Any help that can be provided would be greatly appreciated.
Thank you.

Parents Reply Children
No Data