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
15
Put XamTreeGrid in XamTabControl
posted

Hello, 

I'd like to put a XamTreeGrid in XamTabContol. 

I wrote this code, and the Name and subNode's rows are shown with branch lines.

However, I cannot see the subNode's strings.

How can I fix it? 

<ig:XamTabControl>
    <ig:TabItemEx>
        <ig:XamTreeGrid DataSource={Binding TreeItemList}>
            <ig:XamTreeGrid.FieldLayouts>
                <ig:FieldLayout Key="TreeItemClass">
                    <ig:TextField Name="Name" />
                    <ig:Field Name="SubnodeItemList"/>
                </ig:FieldLayout>
            </ig:XamTreeGrid.FieldLayouts>
        </ig:XamTreeGrid>
    <ig:TabItemEx>
<ig:XamTabControl>

public class TreeItem Class
{
    public string Name { get; set; }
    public ObservableCollection<string> SubnodeItemList { get; set; }
    
    public TreeItemClass()
    {
        SubnodeItemList = new ObservableCollection<string>();
    }
}

public class ViewModel
{
    public ObservableCollection<TreeItemClass> TreeItemList { get; set; }
    
    public ViewModel()
    {
        TreeItemList = DataList;
    }
}

  • 1175
    Verified Answer
    Offline posted

    Hello Helean,

    Thank you for posting in our forum.

    In order to show a hierarchical data in XamTreeGrid, please make the sub node list in the entity class be the collection of the same type as illustrated in the below document.

    Adding xamTreeGrid to Your Page
    https://www.infragistics.com/help/wpf/xamtreegrid-adding

    Your TreeItemClass should look like below:

        public class TreeItemClass
        {
            public string Name { get; set; }
            public ObservableCollection<TreeItemClass> SubnodeItemList { get; set; }
    .....
        }

    I have attached the sample for your reference.

    3348.XamTreeGrid.zip