Click here to Skip to main content
14,978,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 radio buttons, a, b and 2 Grid columns aColumn and bColumn.
I want to change the column widths on radio button check and uncheck.

I tried following code with some variations to remove errors but cant make it to work.

<RadioButton Content="a">
	<Style>
        	<Style.Triggers>
                	<DataTrigger Value="True" >
                        	<Setter TargetName="aColumn" Property="Width" Value="1122*" />
                                <Setter TargetName="bColumn" Property="Width" Value="0" />
			</DataTrigger>
                        <DataTrigger Value="False" >
                                <Setter TargetName="aColumn" Property="Width" Value="561*" />
                        	<Setter TargetName="bColumn" Property="Width" Value="561*" />
                        </DataTrigger>
		</Style.Triggers>                                                                    
	</Style>
</RadioButton>

<RadioButton Content="b">
                            
</RadioButton>


My grid goes like this

<Grid Name="Grid1" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="561*" Name ="aColumn" />
                        <ColumnDefinition Width="561*" Name="bColumn"/>
                    </Grid.ColumnDefinitions>
</Grid> 


Please suggest a way to do it.
Posted
Updated 12-Jun-14 7:39am
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900