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
115
Multilevel XamDataTree with right aligned delete icon
posted

I want to create a Tree View with right aligned delete icon on each node. Alignment of all delete icon should be proper for each node. Also i need checboxes in each and every node.

Till now i have developed below code. But in that delete icon is not aligned properly.

<ig:XamDataTree x:Name="MyTree" Margin="2,40,2,2" Grid.Row="0" Grid.Column="0" ActiveNodeChanged="MyTree_ActiveNodeChanged" NodeExpansionChanged="MyTree_NodeExpansionChanged" NodeCheckedChanged="MyTree_NodeCheckedChanged" KeyDown="MyTree_KeyDown" KeyUp="MyTree_KeyUp" >
<ig:XamDataTree.SelectionSettings>
<ig:TreeSelectionSettings NodeSelection="Single"/>
</ig:XamDataTree.SelectionSettings>
<!-- Enable Check Boxes-->
<ig:XamDataTree.CheckBoxSettings>
<ig:CheckBoxSettings CheckBoxVisibility="Visible"
IsCheckBoxThreeState="True"/>
</ig:XamDataTree.CheckBoxSettings>
<ig:XamDataTree.GlobalNodeLayouts>
<ig:NodeLayout Key="RegionLayout" TargetTypeName="Region"
DisplayMemberPath="Name" CheckBoxMemberPath="isChecked">
<ig:NodeLayout.ItemTemplate>
<DataTemplate>
<DockPanel Width="200">
<Button Tag="{Binding Data.Name}" Background="Transparent" HorizontalAlignment="Right" DockPanel.Dock="Left"
BorderBrush="Transparent"
BorderThickness="0"
Padding="-4" Click="Button_Click_1">
<StackPanel>
<Image Source="/Images/trash.png" Height="15" Width="15" />
</StackPanel>
</Button>
<TextBlock Width="5"></TextBlock>
<TextBlock FontWeight="Bold" Text="{Binding Data.Name}"/>

</DockPanel>
</DataTemplate>
</ig:NodeLayout.ItemTemplate>
</ig:NodeLayout>
<ig:NodeLayout Key="Zone" TargetTypeName="Zone"
DisplayMemberPath="Name" CheckBoxMemberPath="isChecked">
<ig:NodeLayout.ItemTemplate>
<DataTemplate>
<DockPanel Width="200">
<Button Tag="{Binding Data.Name}" Background="Transparent" HorizontalAlignment="Right" DockPanel.Dock="Left"
BorderBrush="Transparent"
BorderThickness="0"
Padding="-4" Click="Button_Click_2">
<StackPanel>
<Image Source="/Images/trash.png" Height="15" Width="15" />
</StackPanel>
</Button>
<TextBlock Width="5"></TextBlock>
<TextBlock FontWeight="Bold" Text="{Binding Data.Name}"/>

</DockPanel>
</DataTemplate>
</ig:NodeLayout.ItemTemplate>
<!-- Disable Check Boxes at the Product Level -->
<ig:NodeLayout.CheckBoxSettings>
<ig:CheckBoxSettingsOverride CheckBoxVisibility="Visible"/>
</ig:NodeLayout.CheckBoxSettings>
</ig:NodeLayout>
</ig:XamDataTree.GlobalNodeLayouts>
<ig:XamDataTree.EditingSettings>
<ig:TreeEditingSettings
AllowDeletion="True"/>
</ig:XamDataTree.EditingSettings>
</ig:XamDataTree>

Please suggest if we can achive it in a different way. But mostly i want to to do it with XamDataTree only not with XAMGrid.