I have the following code.
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100*" />
<ColumnDefinition Width="100*" />
<ColumnDefinition Width="100*" />
<ColumnDefinition Width="100*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100*" />
<RowDefinition Height="100*" />
<RowDefinition Height="100*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Width="30*">
...
</StackPanel>
</Grid>
I am trying to set Stackpanel width to 30% of the cell. I already have referred the post WPF: Setting the Width (and Height) as a Percentage Value . As per the post It should have worked the width as 30* as it is with in the grid. But It is showing the error "30* string cannot be converted to length". So I would like to rectify the error or I just want to get a way to set the stackpanel of width 30% of cell. Thanks.