How do I simply hide a column in a bound XamDataGrid? I've got a column that is exposed in my that I do not want displayed on the View.
Thanks?
Instead, set the Visibility to Collapsed. That should hide your column.
Hi,
I hadn’t heard back from you. I was wondering if you had further questions.
If so, please feel free to contact me.
If you set the FieldLayoutSettings AutoGenerateFields property to false, you can include only the fields that you wish to include in the FieldLayout definition. And that will exclude any other field, if that is what you need.
When I set the Visibility to Hidden, the space on the grid was still occupied. I then set the column width to 0.
Realizing that really couldn't be the correct way to do what I wanted, I dug deeper and found the FieldLayout.Fields collection. What I really wanted, and what I can now do, is have more control over the mapping between my view model and the grid in my view. I think that is the right approach.
As I'm writing this, it occurs to me that I should/could make the view model fields private to achieve the same result.
That said, I'm new to WPF and am finding it difficult to find solutions to the simplest of tasks.
Thanks.
Setting the Visibility to Hidden should suffice to hide the column.
Let me know if you have further questions