これから変更したい:
<Style x:Key="ReportLabelColumn" TargetType="TableColumn">
<Setter Property="Width" Value="120px" />
</Style>
これに:
private Style ReportLabelColumn = new Style(typeof(TableColumn));
ReportLabelColumn.Setters.Add(new Setter(TableColumn.WidthProperty, 120));
しかし、実行しようとすると、次のようなエラーが表示されます。
{"'120' is not a valid value for the 'System.Windows.Documents.TableColumn.Width' property on a Setter."}
120
その値を として受け入れるように、何に変更し120px
ますか?