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>

相关推荐
SL_staff4 分钟前
ERP排程总在纸上谈兵?JVS-APS如何用真实产能约束打通计划与执行闭环
java·人工智能·开源
xcl09256 分钟前
24小时自助健身房系统软件开发实战指南:从架构到部署
java·spring boot
前端snow12 分钟前
ai agent --- 多agent框架之图编排引擎-langgraph
前端
竹林81815 分钟前
OmniPic Studio v3.2.1 核心技术架构与全平台发版解析文档
前端·浏览器
JamesZhang8007815 分钟前
页面内存只涨不跌? 一次泄漏排查, 牵出 WeakMap 的诞生
前端
Z小明18 分钟前
第 6 章 组件进阶
前端·vue.js
江华森21 分钟前
HTTP请求的完整过程详解:从DNS解析到TCP挥手的微秒级实战分析
前端
南青21 分钟前
Vue 3 中后台实战:我踩过的 10 个坑和最佳实践
前端
江华森23 分钟前
HTTPS协议详解——SSL/TLS握手、证书与加密通信
前端
江华森30 分钟前
从一个HTTP请求看网络分层原理:基于华为云ECS的真实抓包实战
前端