Hello,
I have a data class like this:
public class UICameraTree : NotificationObject{ private string _stakeholderName; private ObservableCollection<UICamera> _cameraList = new ObservableCollection<UICamera>(); private ObservableCollection<UICameraTree> _cameraTree = new ObservableCollection<UICameraTree>();
public string StakeHolderName { get { return _stakeholderName; } set { _stakeholderName = value; base.RaisePropertyChanged(() => StakeHolderName); } } public ObservableCollection<UICamera> CameraList { get { return _cameraList; } } public ObservableCollection<UICameraTree> CameraTree { get { return _cameraTree; } }}
And XAML like:
<ig:XamDataTree x:Name="CameraDataTree" Grid.Row="1" Style="{StaticResource DASXamDataTree}" ItemsSource="{Binding UICameraTree.CameraTree}" IsDraggable="True"> <ig:XamDataTree.CheckBoxSettings> <ig:CheckBoxSettings CheckBoxVisibility="Hidden" /> </ig:XamDataTree.CheckBoxSettings> <ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="GroupLayout" TargetTypeName="UICameraTree" DisplayMemberPath="StakeHolderName"/> <ig:NodeLayout Key="ItemLayout" TargetTypeName="UICamera" DisplayMemberPath="CameraList\CameraName /> </ig:XamDataTree.GlobalNodeLayouts></ig:XamDataTree>
How can I get rid off "GroupLayout" and "ItemLayout" from the tree?
Thank you!
David
I am just checking have you been able to resolve your issue? If you need any further assistance with it, I will be glad to help.
Hello Rajesh,
I believe that currently, there is no built in functionality that can terminate the extra space that occurs in the left of the nodes because. This place is reserved for the checkbox and the NodeLineTermiantorl as you can see from the default template of the XamDataTreeNodeControl. I believe that you can change this space based on the current node. For example you can set ValueConverter for the width of the second and third column of the grid named “main”, where they are placed. You can try the following snippet:
In the xaml:
<ColumnDefinition Width="{Binding Node, Converter={StaticResource conWidth}}" />
In the code behind:
public class MyConverterWidth : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
if ((value as XamDataTreeNode).Nodes.Count == 0)
return 0;
return 20;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
throw new NotImplementedException();
Now it adds extra indent for child nodes, any further tweak to fix this?
Also, Isnt there inherent support for this kind of structure?
my requirement is a standard treeview requirement:- i have groups, groups can have subgroups or items. this can go upto 5levels
I investigate this issue and I add the NodeLineControl back to the XamDataTreeNodeControl’s template in order to achieve the desired look. Please find the attached sample where the nodes are ordered in the hierarchy.
I hope this suits your scenario better.
Hi Elena,
The child node does not appear indented when i checked your sample for David.
Child and parent node appears with same indent so its is very difficult to identify the child node.
Can you pls guide how to identation for the child after grouplayout/itemlayout ?
regards,
Rajesh