I am not sure I get you question correctly. If you want to hide the whole column with the binding, you have to explicitly state the source of the binding. If you want to change the visibility of the expander button, you can do that by using a cell style/template selector for the GridViewToggleRowDetailsColumn.
Let me clarify. The problem is that I will get the small + button for the GridViewToggleRowDetailsColumn even when there are no row details data. I want to be able to dynamically hide the + button based on values in the data that populates the gridview. Binding the IsVisible to my data (boolean DataMember) doesn't work.
Is there some other way to dynamically hide the + button based on data populating the GridView? (on a row by row basis)
answered on 12 Dec 2012, 10:21 AM
Thank you for the clarification.
Binding to the IsVisible property won't work, since it is responsible for the Column visibility, not its cells content. Furthermore the binding does not work, because the DataContext of the Column is different from the one for its cells, therefore the Binding cannot find its source property.
To the question itself. The easiest way to do it, as I already mentioned, is to use a Style/DataTemplateSelector for the Column itself.
Another way is to use the Row/CellLoaded events, and temper with the expander button visibility there.