I'm new to WPF so this may be easier than it seems. I have a DataTable object that I set as the itemssource of a combobox. For each row in the DataTable I want a ComboBoxItem. For each ComboBoxItem I want to create a label for every column name and a text box for the corresponding value, in the current row, of that column. Nothing I try seems to work but heres my shot at the datatemplate in XAML.
<Grid x:Name="LayoutRoot" Background="White" Height="107" Width="358">
<ComboBox Name="pCombo" ItemsSource="myTable">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel DataContext="{Binding pCombo.ItemsSource.Columns}">
<TextBlock Text="{Binding ColumnName}"></TextBlock>
</StackPanel>
<StackPanel DataContext="{Binding pCombo.ItemsSource.Rows}">
<TextBox Text="{Binding RowValue}"></TextBlock>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
I know all my Bindings are wrong I just can't figure out what should be there instead. Thanks for anyone that helps me out.