title: How do I add a DataTemplate programmatically in Silverlight using C#?
body: <p>I have a DataGrid that must contain a DataTemplate that should be programmatically defined in code. </p>
  
  <p>This DataTemplate will contain a random number of DataGrids with a random number of columns that will be binded twoway, depending on what I have in the database. This grids will be putted in a StackPanel that is oriented horizontaly.</p>
  
  <p>I know that in Silverlight I have the XamlReader but this is no helpful to me because it will be very hard to build the string that I need to construct the xaml DataTemplate. </p>
  
  <p>Are there any other solutions?</p>
  
  <p>If not, please someone ask the people from Microsoft to implement this functionality in the next .net framework.</p>