如何更改单选按钮上的网格列的宽度选中/取消选中 [英] How to change width of Grid columns on radio button check/uncheck
本文介绍了如何更改单选按钮上的网格列的宽度选中/取消选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2个单选按钮,a,b和2个网格列aColumn和bColumn。
我想更改单选按钮上的列宽检查并取消选中。
我尝试使用一些变体代码来删除错误,但无法使其工作。
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.
推荐答案
这篇关于如何更改单选按钮上的网格列的宽度选中/取消选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文