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
1240
How do you determine the actual width of an InitialAuto sized column?
posted

If a column is sized with InitialAuto, which will also happen if they double click on the column separator to auto size the column, how do you determine the actual size of the column?

The column's ActualWidth property is 0.0 (zero) in this case, and the Width and WidthResolved properties only tell you that it's sized to InitialAuto. I need the real width in pixels that the column is actually sized to.

Thanks,

Mike

Parents
No Data
Reply
  • 28407
    posted

    HI,

     You could get the size of the the first cell and used that width.

     Here a code snippet:

    CellValuePresenter cvp = CellValuePresenter.FromCell(xgrid1.ActiveCell);

          MessageBox.Show(cvp.ActualWidth.ToString());

     Sincerely,

     Matt

     Developer Support Engineer

Children