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
1650
GridControlArea
posted

I am attempting to set the widths of each column.  I have 3 visible columns. The center column is hard coded at (gridname.DisplayLayout..Bands(0).Columns("ColumnName").Width= 44). The other 2 columns will be calculated based on the remainder of the grid width.  However, the GRIDCONTROLAREA is visible so I need to subtract that from my total.

My question is, how to get the width of the GRIDCONTROLAREA? On that note I will need the width of the vertical scroll bar also, just in case it is visible?

 

Thanks

  • 469350
    Verified Answer
    Offline posted

    If you want the columns to fill the available width of the grid, then you don't need to calculate it. Just set the AutoFitStyle property.

    What you would do in this case is set the Width, MinWidth, and MaxWidth of the middle column to 44, so it's locked at a fixed size. Then set AutoFitStyle and the rest of the columns will be adjusted to fit the width of the grid.