Is is possible to programmatically set the columns to the width of the largest text/value in that column?
I know it can be done if you double click on the edge of the column after the grid has been rendered on the view
Yes, call the PerformAutoResize method on the column. I recommend doing this in the InitializeLayout event. And be sure to call the right overload of the method and pass in AllRowsInBand.
Mike Saltzman"] Yes, call the PerformAutoResize method on the column. I recommend doing this in the InitializeLayout event. And be sure to call the right overload of the method and pass in AllRowsInBand.
I would like to use it but where is this PerformAutoResize() method???
Please provide a line of code or two (starting with the Grid itself).
Thanks in advance and best regards,
Gerald
As Mike mentioned, the method is on the column itself; if you're using the InitializeLayout event, it would be something like:
e.Layout.Bands[0].Columns["SomeColumnKey"].PerformAutoResize(Infragistics.Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand);
-Matt