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">
                	<DataTrigger Value="True" >
                        	<Setter TargetName="aColumn" Property="Width" Value="1122*" />
                                <Setter TargetName="bColumn" Property="Width" Value="0" />
                        <DataTrigger Value="False" >
                                <Setter TargetName="aColumn" Property="Width" Value="561*" />
                        	<Setter TargetName="bColumn" Property="Width" Value="561*" />

<RadioButton Content="b">

My grid goes like this

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

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

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