Is it possible to use a Grid as a container for elements with a DataTemplate ? And if not, then how to give the width of the first column of all Grid located in the StackPanel (preferably via Binding )
An example of my xaml:
<ItemsControl> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <Grid.Children> <TextBlock Grid.Column="0" Text="{Binding Path=NameRow}"/> <TextBox Grid.Column="1" Text="{Binding Path=Value1}"/> <Button Grid.Column="2" Content="Test"/> </Grid.Children> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> As you can see, the first column is a Binding to the NameRow property, but if the rows are of different lengths, then the elements float depending on the NameRow . How would you align them along the maximum length of the first column of all the Grid ?