Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3220
xamDataTree - NodeLayout issue with StackPanel in Grid
posted

Hello,

the tree row is not selectable (focusable) when StackPanel is used inside a Grid for a NodeLayout.ItemTemplate.

<ig:NodeLayout Key="main" TargetTypeName="DataItem">
                    <ig:NodeLayout.ItemTemplate>
                        <DataTemplate>
                            <Border BorderThickness="0,0,0,1" BorderBrush="{Binding Data.Color}">
                                <!--<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
                                    <Rectangle Fill="{Binding Data.Color}" Width="25" Height="25"/>
                                    <Label Content="{Binding Data.Label}" Width="200"/>
                                    <TextBox Text="{Binding Data.Value}" Width="50"/>
                                    <Button Content="-" Width="20" Command="{Binding Data.DecValueCommand}"/>
                                    <Button Content="+" Width="20" Command="{Binding Data.IncValueCommand}"/>
                                </StackPanel>-->
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="250"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <Rectangle Grid.Column="0" Fill="{Binding Data.Color}" Width="25" Height="25"/>
                                    <StackPanel Grid.Column="1" Orientation="Horizontal">
                                        <Label Content="{Binding Data.Label}"/>
                                    </StackPanel>
                                    
                                    <StackPanel Grid.Column="2" Orientation="Horizontal">
                                        <TextBox Text="{Binding Data.Value}" Width="50"/>
                                        <Button Content="-" Width="20" Command="{Binding Data.DecValueCommand}"/>
                                        <Button Content="+" Width="20" Command="{Binding Data.IncValueCommand}"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                        </DataTemplate>
                    </ig:NodeLayout.ItemTemplate>
                </ig:NodeLayout>