wpfgridactualwidth

Wpf How to set Grid Column ActualWidth


Is it generally possible in Grid control to set ActualWidth of Column? This property has only getter. May be there is other way to assign some value to it?

I can set MinWidth, can set Width, so I think it would be logical to have possibility to set ActualWidth.


Solution

  • Set the column's Width property:

    column.Width = new GridLength(100, GridUnitType.Pixel);