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.

Hierarchical legend

Thread ID:

Created:

Updated:

Platform:

Replies:

79646 Feb 19,2009 05:21 AM Feb 26,2018 07:35 AM WPF 11
loading
Tags: TreeViewAdv
Saad
Asked On February 19, 2009 05:21 AM

Hi, I am trying to develop a hierarchical legend in one of my charts.

The idea is very much similar to what is shown in the following link:
http://manyeyes.alphaworks.ibm.com/manyeyes/visualizations/us-government-expenses-1962-2004

Is there support in the library that will let me make a legend like this? Or do I have to tweak the code according to my needs? Any other suggestions...?

I am a licensed customer and have access to the source code.

Regards,
Saad

Using:
Essential Studio WPF Edition 2009 vol 1 (7.1.0.21)
VS 2008 .Net framework 3.5


Pavithra J [Syncfusion]
Replied On February 20, 2009 07:30 AM

Hi Saad,

Thanks for your interest in Syncfusion products.

ChartLegend with its item will be automatically loaded while rendering a ChartSeries. So you cannot achieve your requirement with the help of ChartLegend. Also, we could see that the sample from the link provided by you doesn't seems to a be Legend.

You requirement can be satisfied with the help of a TreeView. You can use a seperate TreeView Control and when a TreeView Item is selected you can load the chart series.

Please let us know if you require a sample with TreeView Control and also if you have any queries.

Regards,
Pavithra.J


Saad
Replied On February 24, 2009 08:58 AM

Thanks...I tried what you said. Now, I have a very simple TreeViewAdv with TreeViewItemAdv(s) added in XAML code. The tree looks like this:

+ All
> Item1
>> Item1_1
>>> Item1_1_1
>>> Item1_1_2
>>> Item1_1_3
...
>> Item1_2
...
>> Item1_3
...
> Item2
...
> Item3
...

Here is how I add an item in the tree:














It works fine but every once in a while I get an exception. It occurs randomly and is never raised from my code. It usually happens when the mouse is over(hover not click) any of the tree items.

Exception:

System.InvalidOperationException was unhandled
Message="Specified element is already the logical child of another element. Disconnect it first."
Source="PresentationFramework"
StackTrace:
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at MS.Internal.FrameworkObject.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.AddLogicalChild(Object child)
at System.Windows.Controls.ContentControl.OnContentChanged(Object oldContent, Object newContent)
at System.Windows.Controls.ContentControl.OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding)
at System.Windows.Controls.PopupControlService.RaiseToolTipOpeningEvent()
at System.Windows.Controls.PopupControlService.OnRaiseToolTipOpeningEvent(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at TreeViewItemsControlSource.App.Main() in C:\Documents and Settings\semosaa\My Documents\Visual Studio 2008\Projects\TreeViewItemsControlSource\TreeViewItemsControlSource\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:





Pavithra J [Syncfusion]
Replied On February 25, 2009 08:43 AM

Hi Saad,

Thanks for your interest in Syncfusion products.

We couldn't reproduce the issue mentioned by you. Please refer to the attached sample in which we have used TreeViewAdv and added items to it. You can download the sample from the below given link,

TreeViewSample

Here, in this sample when you click the treeview item , the series corresponding to the selected TreeviewItem will be loaded.

Please let us know if you have further queries.

Regards,
Pavithra.J


Saad
Replied On March 5, 2009 02:25 AM

Thank you for the reply and the solution!
I am doing it the same way as in the example code but the exception still pops up. I'll reply back with my findings if I succeed in fixing this issue. For now, I am using .Net's TreeView control.


Pavithra J [Syncfusion]
Replied On March 6, 2009 12:48 AM

Hi Saad,

Thanks for your interest in Syncfusion products.

We deeply regret for this inconvenience caused.

We are not able to reproduce your mentioned issue. We suspect that there might be some problems with the assemblies installed in your machine. Could you please try uninstalling the EssentialStudio and reinstall it freshly.

Please let us know, if the issue prevails even after the reinstallation.

Regards,
Pavithra.J



Saad
Replied On April 1, 2009 03:32 AM

Hi,

I found a fix to the problem. However, I still don't understand what caused the exception in the first place.

This is what I was doing before:






I wrapped the Checkbox in a StackPanel and also put it in a UserControl later. Both of these approaches somehow fixed the exception I was getting.





... contains checkbox and other controls ...






Regards,
Saad



Pavithra J [Syncfusion]
Replied On April 1, 2009 09:32 AM

Hi Saad,

Thanks for your interest in Syncfusion products.

We are not able to reproduce your mentioned issue. As we said already have you tried uninstalling the EssentialStudio and reinstall it freshly.

Regards,
Pavithra.J


Saad
Replied On April 2, 2009 03:26 AM

Thanks for the suggestion. Yes, I have tried reinstalling and even tried it on a different machine but couldn't get rid of the issue until I tried the solution I posted above.

/Saad


Pavithra J [Syncfusion]
Replied On April 3, 2009 02:27 AM

Hi Saad,

Thanks for your interest in Syncfusion products.

We will analyze more about the issue mentioned by you. If we could reproduce it we will log it as a defect and resolve it in future.

Please let us know if you have further query.

Regards,
Pavithra.J


Himani
Replied On February 25, 2018 08:23 AM

Hi,

I found a fix to the problem. However, I still don't understand what caused the exception in the first place.

This is what I was doing before:






I wrapped the Checkbox in a StackPanel and also put it in a UserControl later. Both of these approaches somehow fixed the exception I was getting.





... contains checkbox and other controls ...






Regards,
Saad



Hi,
I want to download this file

Keerthana Jegannathan [Syncfusion]
Replied On February 26, 2018 07:35 AM

Hi Himani,

As our previous link has been expired, you are not able to download our TreeViewAdv sample. In the updated sample, we have provided the simple TreeViewAdv control with items loaded in it in XAML. Can you please confirm whether you are required this sample? Based on your update, we will create a new sample with TreeViewAdv in order to provide the solution.

Regards,
Keerthana J

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.

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.

;