We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can not create TreeViewItems from CodeBehind

Thread ID:

Created:

Updated:

Platform:

Replies:

98066 Jan 31,2011 02:49 PM UTC Feb 21,2011 12:19 PM UTC WPF 1
loading
Tags: Tools
Administrator [Syncfusion]
Asked On January 31, 2011 02:49 PM UTC

Hi there,

I've tried to create TreeViewItems from CodeBehind. The TreeView is defined in my Xaml without any Items.

This is what I've tried:

private void CreateTree()
{
Global anlegen
TreeViewItemAdv globalItem = new TreeViewItemAdv()
{
Header = "Global",
Tag = "global",
IsExpanded = true
};
TreeViewItemAdv paraZuordnenItem = new TreeViewItemAdv()
{
Header = "Parametergruppen zuordnen",
Tag = "parametergruppen zuordnen"
};
TreeViewItemAdv paraDefItem = new TreeViewItemAdv()
{
Header = "Parameter definieren",
Tag = "parameter definieren"
};
treeViewAdv1.Items.Add(globalItem);
globalItem.Items.Add(paraZuordnenItem);
globalItem.Items.Add(paraDefItem);

}


The method is called after InitialisingComponent and runs through without any Errors. But after all I get this message:

The object reference was not specified on an object instance.


What am I doing wrong?


Deenadhayalan M [Syncfusion]
Replied On February 21, 2011 12:19 PM UTC

Hi Andreas,

Thanks for using our Syncfusion products.

We create a sample with TreeViewAdv as you told. And we are not able to reproduce the issue from our side. We have attached the sample for reference. Please provide us some more information to reproduce the issue so that we can provide the solution at earliest.

Regards,
Deenadhayalan M



TreeView_d3ab2b65.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;