1

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.

monstr
  • 1,680
  • 1
  • 25
  • 44
  • Already have an answer here. http://stackoverflow.com/questions/2947729/is-it-possible-for-a-wpf-control-to-have-an-actualwidth-and-actualheight-if-it-h – Sivasubramanian Jun 26 '14 at 07:27
  • "I can set MinWidth, can set Width, so I think it would be logical to have possibility to set ActualWidth". For what reason? `ActualWidth` is a read-only property. – Clemens Jun 26 '14 at 07:34
  • @Clemens I wanna set width to `Grid` `Column` programmatically, nothing else. – monstr Jun 26 '14 at 07:35
  • Then why not set the `Width` property??? – Clemens Jun 26 '14 at 07:36
  • @Sivasubramanian Unfortunately, `Column` has no method like `Measure` :( – monstr Jun 26 '14 at 07:37

1 Answers1

2

Set the column's Width property:

column.Width = new GridLength(100, GridUnitType.Pixel);
Clemens
  • 123,504
  • 12
  • 155
  • 268