This question is locked. New answers and comments are not allowed.
Hi,
when filling dynamically a radtreeview some treeviewitems needs to be hide.
howhever setting the visibilty to collapsed works but an empty space remains in the treeview for each hided item.
to remove the empty space I follow the example from the forum:
"How to Change the Default Height of a TreeViewItem"
I define the following style:
<Style TargetType="telerik:RadTreeViewItem" x:Key="HideTreeViewItemStyle">
<Setter Property="MinHeight" Value="0"></Setter>
<Setter Property="MaxHeight" Value="0"></Setter>
</Style>
howhever setting the visibilty to collapsed works but an empty space remains in the treeview for each hided item.
to remove the empty space I follow the example from the forum:
"How to Change the Default Height of a TreeViewItem"
I define the following style:
<Style TargetType="telerik:RadTreeViewItem" x:Key="HideTreeViewItemStyle">
<Setter Property="MinHeight" Value="0"></Setter>
<Setter Property="MaxHeight" Value="0"></Setter>
</Style>
In code behind I do the
following:
RadTreeViewItem NewItem = new RadTreeViewItem();
NewItem.Visibility = Visibility.Collapsed; // to hide the view item
NewItem.ItemContainerStyle = this.Resources["HideTreeViewItemStyle"] as Style; // to remove the remaining empty space
RadTreeViewItem NewItem = new RadTreeViewItem();
NewItem.Visibility = Visibility.Collapsed; // to hide the view item
NewItem.ItemContainerStyle = this.Resources["HideTreeViewItemStyle"] as Style; // to remove the remaining empty space
but is not helping (the empty space still
there, see attach screen shot)
Any solutions are welcome..
Henk
Any solutions are welcome..
Henk
9 Answers, 1 is accepted
0
Hi Henk,
Regarding your style question,y you have to use the Style property of the RadTreeViewItem instead of ItemContainerStyle. But still your issue cannot be resolved this way due to a bug in the TreeView.
A possible workaround could be a kind of "restriction" to the collection passed to the RadTreeView. However, this is not preferred approach. We would highly appreciate if you can elaborate more on your scenario and especially what is your ultimate goal? Do you really need to add a collapsed RadTreeViewitems in your tree? This way we could advice you much better and try to avoid the rude workarounds.
Kind regards,
Petar Mladenov
the Telerik team
Regarding your style question,y you have to use the Style property of the RadTreeViewItem instead of ItemContainerStyle. But still your issue cannot be resolved this way due to a bug in the TreeView.
A possible workaround could be a kind of "restriction" to the collection passed to the RadTreeView. However, this is not preferred approach. We would highly appreciate if you can elaborate more on your scenario and especially what is your ultimate goal? Do you really need to add a collapsed RadTreeViewitems in your tree? This way we could advice you much better and try to avoid the rude workarounds.
Kind regards,
Petar Mladenov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0

Henk
Top achievements
Rank 1
answered on 28 Dec 2010, 10:09 PM
Hi Petar,
A bummer that my problem cannot be solved using standard properties of the radtreeview because of the bug. Yes, I can parallel used a list to filter the items needed and dynamically feed the treeview. I am afraid this solution will give more flickering when refreshing. The application we build is an advanced and intelligent workflow application where for example questions are dynamically generated based on conditions that can be dependent from 1 or more questions or other actions (like calculation, subprocesses, database procedures or silverlight screens or reports) and only the questions that are relevant are presented (that is why I used the visibility property). But the hide items (not relevant because of some conditions) are still occupy space....
I hope I will not have to wait months before, like my other RIA services problem with ORM (the screens we used also in our workflow) , that I am still waiting after promisses and promisses!
Henk
A bummer that my problem cannot be solved using standard properties of the radtreeview because of the bug. Yes, I can parallel used a list to filter the items needed and dynamically feed the treeview. I am afraid this solution will give more flickering when refreshing. The application we build is an advanced and intelligent workflow application where for example questions are dynamically generated based on conditions that can be dependent from 1 or more questions or other actions (like calculation, subprocesses, database procedures or silverlight screens or reports) and only the questions that are relevant are presented (that is why I used the visibility property). But the hide items (not relevant because of some conditions) are still occupy space....
I hope I will not have to wait months before, like my other RIA services problem with ORM (the screens we used also in our workflow) , that I am still waiting after promisses and promisses!
Henk
0
Hello Henk,
You can vote for this issue in our PITS (Issue ID 1556 - TreeView: TreeViewItems are not added correctly when Visibility=Hidden ) here and this way we would take it into consideration if it has enough votes.
If you don`t want to use dynamical filtering and your tree is not virtualized, you can try the following:
Hope this will fit in your situation.
Regards,
Petar Mladenov
the Telerik team
You can vote for this issue in our PITS (Issue ID 1556 - TreeView: TreeViewItems are not added correctly when Visibility=Hidden ) here and this way we would take it into consideration if it has enough votes.
If you don`t want to use dynamical filtering and your tree is not virtualized, you can try the following:
<
telerik:RadTreeView
Name
=
"tree"
>
<
telerik:RadTreeView.ItemsPanel
>
<
ItemsPanelTemplate
>
<
StackPanel
/>
</
ItemsPanelTemplate
>
</
telerik:RadTreeView.ItemsPanel
>
</
telerik:RadTreeView
>
Regards,
Petar Mladenov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0

Henk
Top achievements
Rank 1
answered on 04 Jan 2011, 07:16 PM
Nope, the proposed solution does not work :-(
Henk
Henk
0
Hello Henk,
Is your tree virtualized? It would be nice if you could provide your project ( or at least your xaml )so that we could think up a workaround? Thank you for your cooperation.
All the best,
Petar Mladenov
the Telerik team
Is your tree virtualized? It would be nice if you could provide your project ( or at least your xaml )so that we could think up a workaround? Thank you for your cooperation.
All the best,
Petar Mladenov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0

Henk
Top achievements
Rank 1
answered on 05 Jan 2011, 07:58 PM
Hi Petar,
No, the tree is not virtualized but fully in code behind.
Henk
No, the tree is not virtualized but fully in code behind.
Henk
0
Hello Henk,
You could send us a support ticket with your code and you shouldn`t worry about privacy. This way we would investigate the this issue in depth. Thank you in advance.
Greetings,
Petar Mladenov
the Telerik team
You could send us a support ticket with your code and you shouldn`t worry about privacy. This way we would investigate the this issue in depth. Thank you in advance.
Greetings,
Petar Mladenov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0

Tobias
Top achievements
Rank 1
answered on 16 Sep 2013, 08:58 AM
Hi,
do you fixed your problem? It would be nice to hear from you. :)
Regards,
- Tobias
do you fixed your problem? It would be nice to hear from you. :)
Regards,
- Tobias
0
Hello Tobias,
The best way to understand when a bug is fixed is to follow the PITS item. If you do, we will send you an email when its status is changed.
Hence, we suggest you follow the issue that is important for you.
Thank you for understanding.
Regards,
Pavel R. Pavlov
Telerik
The best way to understand when a bug is fixed is to follow the PITS item. If you do, we will send you an email when its status is changed.
Hence, we suggest you follow the issue that is important for you.
Thank you for understanding.
Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>