WPF里面的C1FlexGrid表格控件添加RadioButton单选

如下,普通表单不会这么麻烦,我这边还根据数据控制了是否可以编辑

<c1:Column Header="评审结果" Binding="{Binding ReviewResult}" ColumnName="ReviewResult" Width="200">

<c1:Column.CellTemplate>

<DataTemplate>

<StackPanel>

<StackPanel Orientation="Horizontal" >

<RadioButton Content="是" Name="rbtnIsResult"

Style="{StaticResource Grid-RadioButton}"

IsChecked="{Binding ReviewResult,Mode=TwoWay,Converter={StaticResource RbtnConverter},ConverterParameter=1}" IsEnabled="{Binding RelationWayIsEnabled}"/>

<RadioButton Content="否"

Style="{StaticResource Grid-RadioButton}"

IsChecked="{Binding ReviewResult,Mode=TwoWay,Converter={StaticResource RbtnConverter},ConverterParameter=0}" IsEnabled="{Binding RelationWayIsEnabled}"/>

</StackPanel>

</StackPanel>

</DataTemplate>

</c1:Column.CellTemplate>

加入是普通表单里面的RadioButton,直接加,不用模板

<StackPanel Orientation="Horizontal" Name="radiostack">

<RadioButton x:Name="rbA" Style="{StaticResource Grid-RadioButton}" GroupName="ClosingStatus1" Content="可量产正常条件生产" Margin="0,6,0,0"

IsChecked="{Binding Item.ClosingStatus, Mode=TwoWay, Converter={StaticResource MyConverter}, ConverterParameter=1}" Tag="radionbApqp" IsEnabled="{Binding Data.ClosingStatusReadOnly,Mode=TwoWay,Source={StaticResource Proxy}}" />

<RadioButton x:Name="rbB" Style="{StaticResource Grid-RadioButton}" GroupName="ClosingStatus1" Content="可量产,需要IECR变更" Margin="10,6,0,0"

IsChecked="{Binding Item.ClosingStatus, Mode=TwoWay, Converter={StaticResource MyConverter}, ConverterParameter=2}" Tag="radionbApqp" IsEnabled="{Binding Data.ClosingStatusReadOnly,Mode=TwoWay,Source={StaticResource Proxy}}" />

<RadioButton x:Name="rbC" Style="{StaticResource Grid-RadioButton}" GroupName="ClosingStatus1" Content="不可量产" Margin="10,6,0,0"

IsChecked="{Binding Item.ClosingStatus, Mode=TwoWay, Converter={StaticResource MyConverter}, ConverterParameter=3}" Tag="radionbApqp" IsEnabled="{Binding Data.ClosingStatusReadOnly,Mode=TwoWay,Source={StaticResource Proxy}}" />

</StackPanel>

相关推荐
woho77889916 小时前
不同网段IP的网络打印机,打印、扫描设置
运维·服务器·网络
耗子会飞16 小时前
小白学习固定VM虚拟机的centos服务器的IP
运维·服务器·centos
还是大剑师兰特16 小时前
Vue3 中 computed(计算属性)完整使用指南
前端·javascript·vue.js
我真会写代码16 小时前
深入理解JVM GC:触发机制、OOM关联及核心垃圾回收算法
java·jvm·架构
本喵是FW16 小时前
C语言手记1
java·c语言·算法
井川不擦16 小时前
前端安全通信方案:RSA + AES 混合加密
前端
孜孜不倦不忘初心17 小时前
Ant Design Vue 表格组件空数据统一处理 踩坑
前端·vue.js·ant design
AD_wjk17 小时前
Android13系统集成方案
前端
Joyee69117 小时前
RN 的新通信模型 JSI
前端·react native
somebody17 小时前
零经验学 react 的第6天 - 循环渲染和条件渲染
前端