WPF DataGrid 列隐藏

Window节点加上下面的

xml 复制代码
 <Window.Resources>
     <FrameworkElement x:Key="ProxyElement" DataContext="{Binding}" />
 </Window.Resources>

然后随便加一个隐藏控件

xml 复制代码
<ContentControl Content="{StaticResource ProxyElement}" Visibility="Collapsed" />

然后绑定

xml 复制代码
<DataGridTextColumn
    Width="*"
    Binding="{Binding CompoundName}"
    Header="组分名"
    IsReadOnly="True"
    Visibility="{Binding DataContext.FileListVisibility, Source={StaticResource ProxyElement}}" />
相关推荐
bugcome_com11 分钟前
阿里云 OSS C# SDK 使用实践与参数详解
阿里云·c#
懒人咖10 小时前
缺料分析时携带用料清单的二开字段
c#·金蝶云星空
bugcome_com11 小时前
深入了解 C# 编程环境及其开发工具
c#
wfserial13 小时前
c#使用微软自带speech选择男声仍然是女声的一种原因
microsoft·c#·speech
阔皮大师14 小时前
INote轻量文本编辑器
java·javascript·python·c#
聆风吟º15 小时前
CANN hccl 深度解析:异构计算集群通信库的跨节点通信与资源管控实现逻辑
人工智能·wpf·transformer·cann
kylezhao201915 小时前
C# 中的 SOLID 五大设计原则
开发语言·c#
啦啦啦_999916 小时前
Redis-5-doFormatAsync()方法
数据库·redis·c#
Porco.w16 小时前
C#与三菱PLC FX5U通信
网络·c#
E_ICEBLUE18 小时前
PPT 批量转图片:在 Web 预览中实现翻页效果(C#/VB.NET)
c#·powerpoint·svg