Hi Mike,
I'm currently running into an issue with sizing of columns in some of my grids. I have grid bands with columns that the user cannot edit, and the columns that show in the grid cannot be resized manually by the user because I don't allow them to edit the columns. I'm depending on the grid functionality to appropriately size the columns for me. This doesn't appear to happen all the time. So I have a few questions:
Does the grid have column sizing functionality built in? Right now I have the grid setting for AllowColumnSizing set to Free, and when sizing the columns I am using PerformAutoResize to size the columns in the grid InitializeLayout event handler. That works well when the grid is drawn initially. However, if certain data is changed in other grids or forms, the size of the data in my columns can grow and the column size doesn't adjust to accommodate the larger data value. The data value ends up getting cut off toward the end. I have tried using the AfterCellUpdate event to run PerformAutoResize on the columns to resize after such a change but it does not completely work for me. The column resizes to show a little bit more of the data but not the entire data value in the column. Which leads me to my next question:
What is the best event handler to use to run PerformAutoResize (or some other function?) when a data change causes the data in my columns to grow beyond the column size? I'm using AfterCellUpdate but would InitializeRow be better or maybe some other event? The data in the column can grow quite large so could there be a width property that I need to change to allow the column size to get bigger? Something else?
If required I can attach a sample project that demonstrates the issue. I've attached some screenshots to show the problem.
Thank you,
Steve
Just checking if you had any further questions. Looks like Mike was very through but if you had any follow-up questions, I’d be glad to help.
Please let me know if there is anything I can help with.
Marianne
Hi Marianne ... Mike was very thorough, however, I still could not get my columns to re-size correctly. I'm suspecting it might be some inefficiency in our code or something is causing the PerformAutoResize function to not work correctly. In any case, I had to resort to hardcoding the Width property for the column for now. We will revisit the issue for our next release ... Thank you.