如何在分组的Datagrid视图XAML中隐藏列 [英] How to hide columns in grouped datagrid view XAML
本文介绍了如何在分组的Datagrid视图XAML中隐藏列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有简单的模型代码
I have simple code for model
<pre lang="c#">public class Customer {
public string FirstName {get; set;}
public string LastName {get; set;}
public string Gender {get; set;}
public string WebSite {get; set;}
}
我将它们分组为"DataGrid分组",它将显示所有列,但我想隐藏性别"列.有可能吗?
我尝试过的事情:
尝试在
I group them into the DataGrid Grouped and it will show all columns, but I want to hide the column Gender. Is it possible?
What I have tried:
Try to set Style and
DataContext
推荐答案
上设置样式和
.找到了答案,这很简单.通过将
Found the answer, it is just simple as it is. By define the
DataGrid.Columns
定义为普通
这篇关于如何在分组的Datagrid视图XAML中隐藏列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文