dotnet / dotnet/samples

Create a Custom View Mode for a WPF ListView in dotnet core

Open
#1,825 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
5.1k
Avg merge
9h 11m
Merged PRs (30d)
1

Description

The following example is not working in a dotnetcore 3.0 wpf application while i works fine in dotnetfx:

https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/how-to-create-a-custom-view-mode-for-a-listview

When switching to icon/thumb view i get a empty list and this binding errors:

```
System.Windows.Data Error: 40 : BindingExpression path error: 'ColumnHeaderContainerStyle' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.ColumnHeaderContainerStyle; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'ColumnHeaderContainerStyle' (type 'Style')
System.Windows.Data Error: 40 : BindingExpression path error: 'ColumnHeaderTemplate' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.ColumnHeaderTemplate; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'ColumnHeaderTemplate' (type 'DataTemplate')
System.Windows.Data Error: 40 : BindingExpression path error: 'ColumnHeaderTemplateSelector' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.ColumnHeaderTemplateSelector; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'ColumnHeaderTemplateSelector' (type 'DataTemplateSelector')
System.Windows.Data Error: 40 : BindingExpression path error: 'ColumnHeaderStringFormat' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.ColumnHeaderStringFormat; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'ColumnHeaderStringFormat' (type 'String')
System.Windows.Data Error: 40 : BindingExpression path error: 'AllowsColumnReorder' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.AllowsColumnReorder; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'AllowsColumnReorder' (type 'Boolean')
System.Windows.Data Error: 40 : BindingExpression path error: 'ColumnHeaderContextMenu' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.ColumnHeaderContextMenu; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'ColumnHeaderContextMenu' (type 'ContextMenu')
System.Windows.Data Error: 40 : BindingExpression path error: 'ColumnHeaderToolTip' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.ColumnHeaderToolTip; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'ColumnHeaderToolTip' (type 'Object')
System.Windows.Data Error: 40 : BindingExpression path error: 'Columns' property not found on 'object' ''PlainView' (HashCode=55724670)'. BindingExpression:Path=TemplatedParent.View.Columns; DataItem='ScrollViewer' (Name=''); target element is 'GridViewHeaderRowPresenter' (Name=''); target property is 'Columns' (type 'GridViewColumnCollection')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.