WPF表格控件的列利用模块适配动态枚举类

将枚举列表转化到类内部赋值,在初始化表格行加载和双击事件时,触发类里面的枚举列表的赋值

<c1:Column Header="变更类型" Binding="{Binding ChangeType, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" ColumnName="ChangeType" Width="150" TextWrapping="True">

<c1:Column.CellTemplate>

<DataTemplate>

<c1:C1ComboBox BorderThickness="0" Style="{StaticResource StackPanel-C1ComboBox-Multiple}" Width="150" IsDropDownOpen="True"

Margin="0" SelectedValue="{Binding ChangeType,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True }"

DisplayMemberPath="Value" SelectedValuePath="Key"

ItemsSource="{Binding StackClassChangeTypeList}"/>

</DataTemplate>

</c1:Column.CellTemplate>

</c1:Column>

效果

相关推荐
爱吃烤鸡翅的酸菜鱼10 小时前
Java 事件发布-订阅机制全解析:从原生实现到主流中间件
java·中间件·wpf·事件·发布订阅
STRUGGLE_xlf12 小时前
AI大模型生成表格粘贴到 Word 后出现双线边框的原因与解决方案
word
青春不败 177-3266-052012 小时前
R语言与DSSAT作物模型
r语言·生态学·作物模型·数字农业·dssat模型·农业科学
weixin_4166600712 小时前
2026 年 AI 对话转 Word 工具分析:Pandoc、Typora、aitoword 怎么选
人工智能·word
asyxchenchong88813 小时前
农业系统模拟APSIM全流程详解(气象/土壤/碳氮平衡/NG版本)附R批量处理代码
开发语言·r语言
武藤一雄1 天前
WPF中ViewModel之间的5种通讯方式
开发语言·前端·microsoft·c#·wpf
F_D_Z1 天前
Word Embedding :从分布式假设到神经网络语言模型
分布式·word·embedding
asdzx672 天前
C#:通过模板快速生成 Word 文档
开发语言·c#·word
CSharp精选营2 天前
都是微软亲儿子,WPF凭啥干不掉WinForm?这3个场景说明白了
c#·wpf·跨平台·winform
xinixini2 天前
2026年马年日历模板大全 可编辑Excel/Word/PSD/PDF素材合集
pdf·word·excel·日历