New Developer
New Developer

Reputation: 3305

wpf data template binding (Dynamically generating form)

I want to dynamically generate a form in WPF. I would like to do it using XAML not from the code behind(Which I am currently doing.).

If I have a data template like below, What is the parent controller that I can use for this.(Like we use Listbox)

I have dataTemplate like below

<DataTemplate x:Key="FieldTemlate">
       <TextBlock HorizontalAlignment="Left"  VerticalAlignment="Top" />
       <TextBox  VerticalAlignment="Top"  Width="40" />
</DataTemplate>

Upvotes: 2

Views: 897

Answers (1)

JoanComasFdz
JoanComasFdz

Reputation: 3066

ItemsControl is what you need.

Here you can find an example.

Upvotes: 3

Related Questions