WPF ListView.HeaderTemplate property not found
While trying to apply DataTemplates to a ListView, i found out that the
ListView.HeaderTemplate
property does not exist in my project, despite it being used in the "Item templates for list view" example in the documentation (see: https://learn.microsoft.com/en-us/windows/apps/design/controls/item-templates-listview#table-list-item)
With there being no info on what version of anything or whether any specific nuget package is required for this feature, i am completely lost.
project info:
VisualStudio version: 17.5.3
ouput: exe / Windows
Target Framework: .NET 7.0
Target OS Version: 10.0.22621.0
WPF enabled
C# Version: 11.0
full project: https://github.com/Toreole/BasicCombatlogParser10 Replies
can you show the code where you have the problem.. i dont want to dig through the repo to guess what you could have done
well right here
hmm i doubt it but lemme ask nontheless.. do you have customcontrol that maybe also is named ListView?
alternative.. did you try to fill out the headertemplate with content.. maybe designer a bit buggy? (wouldnt be the first time)
No i do not have a custom control that is named ListView. This same issue also occurs in a blank project (WPF Template project) with only a MainWindow.xaml
and unfortunately it doesnt seem to be just designer being buggy this time
if you select listview then f12 to go to the definition can you check if there is actually a headertemplate dependencyproperty?
i hope at least that were the steps.. currently dont have vs open
the only DependencyProperty immediately visible in ListView when checking the "ListView [from metadata]" file is
ViewProperty
aaah god dammit that dependecyproperty is uwp not wpf
https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.listview?view=windowsdesktop-7.0 here for wpf
ListView Class (System.Windows.Controls)
Represents a control that displays a list of data items.
huh so the article i was looking at wasnt for wpf at all then
awesome that it all looks the exact same so you dont know until its too late
thank you
jea i also had to look twice before i saw that..xD