Binding does not work on member fields
In retrospect this was pretty obvious which is why I couldn't find anything on Google. I tried for hours to bind to a TreeView. I implemented a subset of the System.Data classes including DataSet, DataTable and DataColumn. I wanted to display a tree view table columns listed under each table. I was able to get the tables to bind or the columns to bind but not both. As it turns out the property exposing the ObservableCollection must not be declared as readonly -- you must instead declare a private set:
Bad:
public readonly DataColumns Columns;
Good:
public DataRows Rows { get; private set; }
Comments (0)
You don't have permission to comment on this page.