-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Describe the bug
自从3.0
升级到3.2
后发现用到DataGrid的地方,当ItemSource.Count=0
时,DataGrid不会显示ColumnHeader
,翻看了其模板后发现是特意这么改的。判断逻辑为当HasItem
=False
,即没有数据的时候显示的是hc:Empty
,如下。
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent>
<ScrollViewer x:Name="DG_ScrollViewer" Focusable="false">
...
</ScrollViewer>
</hc:ToggleBlock.CheckedContent>
<hc:ToggleBlock.UnCheckedContent>
<hc:Empty />
</hc:ToggleBlock.UnCheckedContent>
</hc:ToggleBlock>
这样一来表格区域一片空白,看着会很奇怪,就比如我这个界面:
尤其是在一些设置界面,首次打开肯定是没有数据的,也不显示表头。。。
Expected behavior
是不是可以考虑参照Web上的表格显示效果,保留表头,下方显示hc:Empty
,并给hc:Empty
定以一个默认模板,这样不会导致界面上啥都不显示。
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- .net: 4.6.1
- IDE vs2019
- Version 3.2.0
Metadata
Metadata
Assignees
Labels
No labels