Datagrid and XamlWriter.Save

Jan 14, 2010 at 8:40 AM

Hello,

When I create a new DataGrid in code and add a column to it like:

var myDataGrid = new DataGrid();
var column = new DataGridTextColumn { Header = "Header" };
myDataGrid.Columns.Add(column);

I would like to generate the XAML of it via the XamlWriter.Save(myDataGrid).

The output of the XamlWriter.Save results in a <DataGrid>...</DataGrid>tag but i'm missing the DataGridTextColumn :(

It looks like the XamlWriter isn't saving the datagrid columns to the Xaml output :(

Any idea why? Or am I missing something? Is there a workaround for this?

Greetz,

 

Mar 22, 2010 at 6:32 AM

Hi, I have this problem too. I just start reading about how the serialization process work. 

Please if you found how to solve this post the solution. Thanks.

May 12, 2010 at 4:38 AM
I have the same problem too, it seems to be a bug