I have created a WPF tooklit datagrid in C# and the ItemsSource is set in the XAML. The columns are automatically generated.
I am trying to do a datagrid that uses an ObservableCollection, pretty much like what is on this website.
At the bottom you will find a sample that you can download (here is the link)
My problem is that I'm trying to change certain properties of a specific column (example: Datagrid.Columns[index].Property) but this does not seem to work since the the column count is always equal to 0. Therefore, I cannot change the properties by using the index that I want to use because there seems to be nothing in the Columns collection. Yet at runtime there are columns that are displayed.
So, how can it be possible that column count is equal to 0?
and
How can I change the properties of a specific column in my situation?