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
20
XamDataTree
posted

Hi,

I'm trying to use the XamDataTree to show an hierarchical object.

For some reason I get in the tree unwanted nodes were their name is the layout name.

How do I remove those nodes/ don't show them ?

( Hight=0 doesn't work, I'm causes an exception in the scroll).

 

My object looks like this:

public class LevelA : INotifyPropertyChanged

    {      

public IEnumerable<LevelB> Machines { get { return dictionaryMachines.Values; } }

        public string Name { get { return a.Name; } }      

    }

 

public class LevelB : INotifyPropertyChanged

    {

        public IEnumerable<LevelC> Applications { get { return dictionaryApplications.Values; } }      

        public string Name { get { return b.Name; } }

   }

 I connected my tree to the object in code:

Each level contains a list of the next level.

IEnumerable<LevelA> levelA = MyProject.LevelA.Values;

SitesDataTree.ItemsSource = levelA;

 

Now in each level I want to show the Name property of the object.

 My xaml:

<ig:XamDataTree.GlobalNodeLayouts>

                    <ig:NodeLayout Key="SiteLayout" TargetTypeName="LevelA" DisplayMemberPath="Name" >   </ig:NodeLayout>

                    <ig:NodeLayout Key="MachinesLayout" TargetTypeName="LevelB" DisplayMemberPath="Name" >  </ig:NodeLayout>

                <ig:NodeLayout Key="Applications" TargetTypeName="LevelC" DisplayMemberPath="Name"> </ig:NodeLayout>

</ig:XamDataTree.GlobalNodeLayouts>

 For some reason I get in the tree unwanted nodes were their name is the layout name:

 

This is very urgent for me. Please help!

  • 1670
    posted

    Hi tkitov,

    I am attaching a sample ,where i modified a little bit the logic from your code and implemented a sample where you have a hiearchical data like the following :

    Sites

              Machines

                              Applications

    If you still have any difficulties to build the XamDataTree that you need, please share them in order to assist you!

    Regards,

    Nikola