I have a listview.view and a gridview inside of it to display my objects data. I’m using DisplayMemberBinding to reference the objects fields in the gridview.
What I want to do is grab all the data from a specific column.
If I reference the myGridView it’s only properties are the columns themselves. If I reference the myListView I can reference the items in it but not the columns.
I assume since the list contains data from my objects I could just output the myListView.Items back into a myObject list and grab the value at the objects properties but is that the only way? Thanks.
In WPF it’s normal to use databinding, so you already have the access to your data through your own property somewhere, either in the code-behind or in the viewmodel if you use MVVM. The datagrid is only displaying your data and you shouldn’t have to go through the UI element to access your data.
Ah okay, so the best course of action is to reference the object themselves rather than the UI grid. Thanks.
C# devs
null reference exceptions