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>

相关推荐
GISer_Jing9 分钟前
前端性能指标及优化策略——从加载、渲染和交互阶段分别解读详解并以Webpack+Vue项目为例进行解读
前端·javascript·vue
不知几秋11 分钟前
数字取证-内存取证(volatility)
java·linux·前端
水银嘻嘻2 小时前
08 web 自动化之 PO 设计模式详解
前端·自动化
珊珊而川2 小时前
ChatPromptTemplate创建方式比较
服务器·langchain
chxii3 小时前
5java集合框架
java·开发语言
欧先生^_^3 小时前
Linux内核可配置的参数
linux·服务器·数据库
Zero1017133 小时前
【详解pnpm、npm、yarn区别】
前端·react.js·前端框架
若风的雨3 小时前
【deekseek】P2P通信路由过程
服务器·网络协议·p2p
&白帝&4 小时前
vue右键显示菜单
前端·javascript·vue.js
Wannaer4 小时前
从 Vue3 回望 Vue2:事件总线的前世今生
前端·javascript·vue.js