Well, you can just go ahead and do it I guess.
This small piece of code pretty much does what you want i believe..
XAML:
<DataGrid ItemsSource="{Binding Items}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ContentControl Content="{Binding UI}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
Code-behind:
public partial class MainWindow : Window
{
public List<Model> Items { get; set; }
public MainWindow()
{
InitializeComponent();
var textblock = new TextBlock();
textblock.Text = "I'm a textblock";
var button = new Button();
button.Content = "I'm a button";
var combobox = new ComboBox();
combobox.Items.Add("Item1");
combobox.Items.Add("Item2");
this.Items = new List<Model>(new[] {
new Model(textblock),
new Model(button),
new Model(combobox)
});
this.DataContext = this;
}
public class Model
{
public UIElement UI { get; set; }
public Model(UIElement ui)
{
this.UI = ui;
}
}
}