As far as I know, the only way to create a DataTemplate
in Silverlight
is to use XamlReader
. Basically you would just pass it the XAML as a string and it will give you back a DataTemplate. Byron's solution would apply to WPF but Silverlight (to the best of my knowledge) does not support FrameworkElementFactory.
Defining Silverlight DataGrid Columns at Runtime
Take note of option #2 for DataGridTemplateColumn
.