I am wondering if anyone know something about this issue. It seems like the default template provided here for ListViewItem does not support DisplayMemberPath of ListView.
Example
<ListView ItemsSource="{Binding SomeSource}" DisplayMemberPath="Name" />
will not display the items as expected. It will work if I replace the GridViewRowPresenter with a ContentPresenter. So my workaround to write a fully working template is to write a DataTrigger for DisplayMemberPath with Value="" and there I set the Template to a Template containing the GridViewRowPresenter. If I will not do this a GroupStyle with ItemsPresenter will not work.
My Question: Is this a bug or am I doing something wrong?
I asked a similar question here
The
DisplayMemberPathproperty is actually a shortcut that will tell WPF to create the default item template with nothing more than aTextBlockwith it’s Text bound to whatever field is inDisplayMemberPathIf you overwrite the item template in addition to setting
DisplayMemberPath, then you are essentially overwriting the template thatDisplayMemberPathcreated for you, so that property becomes useless.