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>

相关推荐
rzl029 分钟前
java web5(黑马)
java·开发语言·前端
Amy.Wang11 分钟前
前端如何实现电子签名
前端·javascript·html5
今天又在摸鱼13 分钟前
Vue3-组件化-Vue核心思想之一
前端·javascript·vue.js
蓝婷儿15 分钟前
每天一个前端小知识 Day 21 - 浏览器兼容性与 Polyfill 策略
前端
百锦再17 分钟前
Vue中对象赋值问题:对象引用被保留,仅部分属性被覆盖
前端·javascript·vue.js·vue·web·reactive·ref
戒不掉的伤怀18 分钟前
【Navicat 连接MySQL时出现错误1251:客户端不支持服务器请求的身份验证协议;请考虑升级MySQL客户端】
服务器·数据库·mysql
超喜欢下雨天18 分钟前
服务器安装 ros2时遇到底层库依赖冲突的问题
linux·运维·服务器·ros2
jingling55522 分钟前
面试版-前端开发核心知识
开发语言·前端·javascript·vue.js·面试·前端框架
搬码临时工25 分钟前
小企业如何搭建本地私有云服务器,并设置内部网络地址提供互联网访问
运维·服务器
拾光拾趣录27 分钟前
CSS 深入解析:提升网页样式技巧与常见问题解决方案
前端·css