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>
效果
原文地址:https://blog.csdn.net/u012269637/article/details/144254883
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!