After installing 12.1, I've noticed that code that was auto sizing all the grid columns using the PerformAutoResizeColumns method now seems to be resizing based only on the column headers. I've created a simple test program in 11.2 and 12.1 and the results are different. I've tried setting the AutoResizeColumnWidthOptions to All, but it doesn't seem to have any effect. I've attached a zip file that contains both versions of the project.
Hi,
I will be happy to assist you with this issue.
I have tested your sample and was able to reproduce the issue mentioned in your post. I have created case number CAS-96759-C77CD2 for you to better assist you with this issue going forward. To access the case, simply log into your Infragistics Account and click on SupportActivity.
Please let me know if you have additional questions regarding this matter.
Our developers have completed their review of development ID 117972. They have determined that this is not a bug for the following reasons:
This worked previously because the grid was initializing certain metrics before the first time the grid painted. This was wrong and caused other problems.
The new behavior that you are getting here is correct. The PerformAutoResizeColumns is sizing based on the VisibleRows in the grid, and since the gird has never painted, there are no visible rows at this point.
You can easily work around this by specifying a number or row or by specifying AllRowsInGrid instead of VisibleRows. Or, you can call Update on the grid right before calling PerformAutoResizeColumns which would force the grid to paint.
If you have more information regarding this issue that may require a reevaluation, or require further explanation, please let me know.
Thanks for looking into this. The Update call seems to solve the problem. The other two suggestions don't work for me (I don't see an overload of PerformAutoResizeColumns that takes the number of rows, although that can be done with CalculateAutoResizeWidth; using all rows takes far too long).
I do think this could have been documented better (in PerformAutoResizeColumns) and/or mentioned as a change in the revision history, but I appreciate the quick response and it does resolve our problem.
asteingart53 said:I don't see an overload of PerformAutoResizeColumns that takes the number of rows
There's no overload of PerformAutoResizeColumns that takes a number of rows, but there is an overload of the PerformAutoResize on the UltraGridColumn that has it. So you could loop through the columns and call this method on each one.
asteingart53 said:I do think this could have been documented better (in PerformAutoResizeColumns) and/or mentioned as a change in the revision history, but I appreciate the quick response and it does resolve our problem.
Sorry about that. Fact is, we were not aware of the bug that was causing all of the rows to be loaded, so we could not document the change in behavior. The fix which changed this behavior was (seemingly) in a completed unrelated area.