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.
Dhiraj,
By "Cell/Footer" I assume you mean in the Summary Row for a particular column of the WinGrid?
Hi,
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
Since there is currently no way to do this, I have submitted this idea to our product management team. The reference number for this product idea is PI13050148.
If you would like to follow up on your product idea at a later point, you may contact Developer Support management via email. Please include the reference number of your product idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
I am quite willing to turn AutoFit off and resize it manually, but I cannot figure out how to do this.
I would appreciate any insight you can find on this.If it is not currently possible, I think this would make a good enhancement, even if it is just to allow manual resizing of each control individually.
Okay, I see what you mean, now. I don't think there is any way to do this. The key here is that you have AutoFit turned on, so everything is stretched to fit with the width of the grid. The stretching does not actually apply to the properties of the column or the RowLayoutInfo, it happens after the fact, and an equal width is distributed to all of the items in the layout. There's no way to change this currently.