Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
775
Grid Column Auto Size Issue
posted

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

 

Parents
  • 12875
    posted

    Hi Mike,

     

    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

Reply Children