This is what I am doing. I create a datatable using (look at http://blogs.telerik.com/vladimirenchev/posts/09-04-23/lightweight_datatable_for_your_silverlight_applications.aspx) and I set the item source to the grid which works fine. The reason using datatable being the columns that I want to display are never same and keep changing.
Now I want to add a ColumnGroupDescriptor. This is what I did
DataTable dataTable =
Code that fills the data
ColumnGroupDescriptor descriptor =
However my problem is at the code fails at "t
.myGrid.Columns" and says "Index was out of range. " which tells me the grid has not be completly
loaded because when I debug it says column count is 0 eventhough the itemsource is set to a datatable that
has 3 columns.
So I try to put the ColumnGroupDescriptor code in DataLoaded event of the grid.
But the error I get now is
"Cannot change ObservableCollection during a CollectionChanged or PropertyChanged event."
Can anyone please help me out.