I'm attempting to override the GetPreferredSize method in order to size the user controls embedded in my grid.
I'm calling
e.Layout.Bands(1).PerformAutoResizeColumns(
True, Infragistics.Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand)
This hits my override; however, only the width gets applied.
How can I adjust the height to fit my user control?
Hi,
PerformAutoResizeColumns sizes the width of the columns. A column does not have a height. It sounds like what you need to do is call PerformAutoSize on the row(s) in the grid. By default, all of the rows are the same height, so you would only need to call PerformAutoSize once on the first row in the grid. If you set RowSizing on the grid to allow variable row-heights, then you could use InitializeRow to size each row as it is initialized.
I'd say this was a non-intuitive solution because the GetPreferredSize method has a height argument that has to be supplied, even though it apparently doesn't do anything.
However, your suggestion of using the InitializeRow event worked great!
Thanks, Mike