How do I recreate the following XAML databinding in code? I have most of it except for the DataTemplate definition.
Here is an example of the DataBinding in XAML
<GridViewColumn Width="140" Header="Name">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=Label}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
Here is the code I have so far:
return new GridViewColumn()
{
Header = header,
Width = width,
DisplayMemberBinding = new System.Windows.Data.Binding(bindingProperty)
};
The problem is, how did I set the CellTemplate for the DataTemplate through code?