gpt4 book ai didi

wpf - WPF DataGrid行标题不可见

转载 作者:行者123 更新时间:2023-12-03 11:02:51 25 4
gpt4 key购买 nike

我有WPF-MVVM DataGrid。我想使用行标题,但是它是不可见的。
我试图用RowHeaderWidth设置它,但是没有任何效果。
下面是我的代码:

<Grid DataContext="{Binding Tours}">
<DataGrid Grid.Row="0"
x:Name="tourDataGrid"
RowHeaderWidth="27"
ItemsSource="{Binding}"
AutoGenerateColumns="False"
Height="360">

怎么了 ?

提前谢谢了...

最佳答案

试试这个:

<Grid DataContext="{Binding Tours}">
<DataGrid Grid.Row="0"
x:Name="tourDataGrid"

HeadersVisibility="All"

RowHeaderWidth="27"
ItemsSource="{Binding}"
AutoGenerateColumns="False"
Height="360">

关于wpf - WPF DataGrid行标题不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48125369/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com