To get a column of a ListView
in WPF we can do
((GridView) someListView.View).Columns[index]
But how to get a GridViewColumn
knowing only the name of its header?
To get a column of a ListView
in WPF we can do
((GridView) someListView.View).Columns[index]
But how to get a GridViewColumn
knowing only the name of its header?
You should try this:
((GridView) _lvContacts.View).Columns.FirstOrDefault(x => (string) x.Header == "Name");
Of course, you have to be sure the column's header is only a string (just like in your sample code).