This is a migrated thread and some comments may be shown as answers.

Treeview invisible

3 Answers 153 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 17 May 2013, 08:17 PM
I am evaluating the DevCraft suite for WPF, and I've run into an odd problem.  

I'm developing an internal application for my company.  It uses .NET 4.5, WPF, Prism, and Entity Framework 5.0.

When I instantiate a RadTreeView control and populate it with static RadTreeViewItem objects in the XAML, it doesn't display.  If I set the background color, I get a colored rectangle with no items.  Using Snoop I can see that it exists in the visual tree and the HasItems property is true.  This behavior is the same regardless of whether I navigate to a region using Prism or declare it manually in the shell window.

If I create a separate application and place the static test RadTreeView in it, it behaves as expected.

Any ideas?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 20 May 2013, 11:10 AM
Hello,

I already answered to your question in your support ticket. However I will post the same answer here so others from the community can find it.

I can not be sure about your scenario and the reason behind this behavior. However, such behavior may occur if you use our NoXaml dlls. If you do, the controls used in your project will be created (added to the visual tree) but they will not be visualized because their visual representation (XAML code) is not available. You can read more information about the usage of our NoXaml dlls in this article. If you are not using the NoXaml dlls we will kindly ask you to provide us with more information (and snippets) about your scenario. How you load your modules and how are they structured? If we reproduce that behavior on our side we will be able to suggest the best approach in your case.

I am looking forward to hearing from you.

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Sreelaskshmi
Top achievements
Rank 1
answered on 09 Jun 2017, 08:36 AM

Hi,

I am using "FallbackValue" in ItemSource binding for Treeview Control, till Data loaded completely.

I am able to see FallbackValue till control loaded fully with data.But its coming vertically.I want to display it as Horizontally.

Please refer attachment and suggest some solution.

Sample code as below.

<telerik:RadtreeView ItemSource ={Binding Data,FallBackValue=Loading..,IsAsync=True} />

Thanks,

Mohan

0
Martin Ivanov
Telerik team
answered on 13 Jun 2017, 10:57 AM
Hi Mohan,

This behavior is expected. The ItemsSource expects a collection, so if you set it to a string value (a collection of char), the treeview will be populated with it. So, a node will be created for each char from the string. In your case you will have nodes for "L", "o", "a" and "d". 

To achieve your requirement you will need to use a different approach. For example, you can hide the treeview while the data is loading and display a TextBlock saying that the treeview is loading. After the data is loaded, show the treeview and hide the TextBlock.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeView
Asked by
Matt
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Sreelaskshmi
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or