In the design of the TreeView editor, you want to treeitemname the subsequent edit box check boxes neatly.
Refer to the TreeListView provided by Microsoft and find that it adjusts the margin properties according to the hierarchical relationship.
My side, in the same way, to achieve the width of the reduction, you can achieve the desired effect.
"TreeNodes"Itemssource="{Binding Path=childs,mode=twoway}"> <grid datacontext="{Binding}"Width="{Binding level,Converter={StaticResource Leveltowidthconverter}}"><Grid.ColumnDefinitions> <columndefinition width="*"/> <columndefinition width=" -"/> <columndefinition width=" -"/> <columndefinition width=" -"/> <columndefinition width=" -"/> <columndefinition width=" -"/> </Grid.ColumnDefinitions> <textblock text="{Binding Name}"/> <checkbox grid.column="1"Ischecked="{Binding Ischeck}"isenabled="{Binding Path=datacontext.isinput,relativesource={relativesource mode=findancestor,ancestortype={x:type Page }}}"> <i:interaction. Triggers> <i:eventtrigger eventname="Click"> <i:invokecommandaction command="{Binding Path=datacontext.nodechangecommand,relativesource={relativesource mode=findancestor,ancestortype={x : Type Page}}}"CommandParameter="{Binding Id}"/> </i:EventTrigger> </i:interaction. triggers> </CheckBox> <checkbox grid.column="2"Ischecked="{Binding Hasadd,mode=twoway}"isenabled="{Binding path=datacontext.isinput,relativesource={relativesource mode=findancestor,ancestortype={x:type Page} }}"> </CheckBox> <checkbox grid.column="3"Ischecked="{Binding Hasedit,mode=twoway}"isenabled="{Binding path=datacontext.isinput,relativesource={relativesource mode=findancestor,ancestortype={x:type Page} }}"> </CheckBox> <checkbox grid.column="4"Ischecked="{Binding Haseditdetail,mode=twoway}"isenabled="{Binding path=datacontext.isinput,relativesource={relativesource mode=findancestor,ancestortype={x:type Page} }}"> </CheckBox> <checkbox grid.column="5"Ischecked="{Binding Hasdelete,mode=twoway}"isenabled="{Binding path=datacontext.isinput,relativesource={relativesource mode=findancestor,ancestortype={x:type Page} }}"> </CheckBox> </Grid> </HierarchicalDataTemplate>
WPF Treegrid Binding Simple Implementation method