Hello:
I have two application both using WinForms UltraGrid (ver 12.1) with multiple bands (max 10), App1 and App2.
1. In App1 when I auto resize by double clicking the column right boundary the column, the column resizes itself to fit the contents of the column, not the caption. In App2 the same action resizes to the caption width. How can I make App2 behave like App1?
2. Similarly I have the exact same code in both apps that does the resize. The same behavior happens as described in #1. How to fix that?
Exact same code in both apps:
_ultraGrid.DisplayLayout.Bands[0].PerformAutoResizeColumns(false, PerformAutoSizeType.VisibleRows, AutoResizeColumnWidthOptions.IncludeCells | AutoResizeColumnWidthOptions.IncludeHeader);
Thx
Hello,
1) This is controlled by DisplayLayout.Override.AutoResizeColumnWidthOptions. You can set this to measure the cells, header, summary rows, or all three.
2) The most likely reason for this is the timing of when PerformAutoResizeColumns is called. Since VisibleRows is specified, it's possible that App2 calls this before the grid is painted, or at another time when the rows are not visible. Try using PerformAutoSizeType.AllRowsInBand and see if that makes a difference.
I've tried to use AutoResizeColumnWidthOptions with no luck. Also timing is unlikely, since the resize is triggered by a right mouse click context menu, the grid is fully formed. I'm at a loss to explain this..
I'm not sure why PerformAutoResizeColumns is not producing the result you expect in this instance. Is it possible for you to send over a sample application that I can investigate?
Found the issue. We are formatting the text based on country which overrides the Infragistics column settings.
Thx!