Unable to set Row/Column of items within an ItemsControl with an ItemsTemplatePanel Grid style
As per topic, here is a XAMLToy ready example:
The square ends up at [0,0] and instead [1,1].
This issue only seems to happen when adding individual items to an ItemsControl. Setting the Grid's Row/Column works fine when using an ItemsSource+ItemsTemplate.
Code: Select all
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Rectangle Grid.Row="1" Grid.Column="1" Fill="Green"/>
</ItemsControl>
</Grid>
This issue only seems to happen when adding individual items to an ItemsControl. Setting the Grid's Row/Column works fine when using an ItemsSource+ItemsTemplate.
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: Unable to set Row/Column of items within an ItemsControl with an ItemsTemplatePanel Grid style
Hi, this is a bug, Noesis is wrapping ItemsControl items with a ContentPresenter as container, even when items already are a UIElement. In WPF when items are UIElement they are directly the item and container in the items control. This is why Grid.Row/Column is not working in Noesis but it works in WPF.
We'll fix it for next release.
We'll fix it for next release.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 62 guests