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>

相关推荐
niuTaylor17 分钟前
从入门到精通:CMakeLists.txt 完全指南
linux·服务器·cmake
不当菜虚困1 小时前
JAVA设计模式——(二)组合模式
java·设计模式·组合模式
来自星星的坤2 小时前
Vue 3中如何封装API请求:提升开发效率的最佳实践
前端·javascript·vue.js
jack_xu2 小时前
经典大厂面试题——缓存穿透、缓存击穿、缓存雪崩
java·redis·后端
镰圈量化2 小时前
Django 实现服务器主动给客户端发送消息的几种常见方式及其区别
服务器·django·sqlite
vvilkim3 小时前
全面解析React内存泄漏:原因、解决方案与最佳实践
前端·javascript·react.js
vvilkim3 小时前
React批处理(Batching)更新机制深度解析
前端·javascript·react.js
CHQIUU3 小时前
Java 设计模式心法之第4篇 - 单例 (Singleton) 的正确打开方式与避坑指南
java·单例模式·设计模式
Bayi·3 小时前
前端面试场景题
开发语言·前端·javascript
碎梦归途3 小时前
23种设计模式-结构型模式之享元模式(Java版本)
java·开发语言·jvm·设计模式·享元模式