I am using the UltraGrid Control in CardView mode with RowLayoutStyle set to ColumnLayout, and CardSettings.Style set to StandardLabelsI 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.
Hi,
I don't think this is possible. But I'm not entirely sure I understand what you want. If the size of the label isn't the same as the size of the cell, wouldn't they cease to line up properly?
Maybe it would help if you could post a screen shot showing what you want.
I want to know is there any way to add the lable in a Cell/Footer of a grid.
Please share the sample code if any.
Thanks in Adavnce.
Regards
Dhiraj
Dhiraj,
By "Cell/Footer" I assume you mean in the Summary Row for a particular column of the WinGrid?