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

Modifying style of RadTreeViewItems

6 Answers 168 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 10 Nov 2008, 05:42 PM
How can I change the height of the items in a databound RadTreeView?
If I bind RadTreeView to a datasource, the RadTreeViewItems are automatically created with a MinHeight of 24.
I like to have a MinHeight based on the FontHeight of the TextBlock withing the HierarchicalDataTemplate.
Is this possible?

Otherwise, is it possible overriding the MinHeight using a (default) Style for RadTreeViewItem?
This style should be BasedOn the style used by default. Is it possible to do this?

Thanks

6 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 11 Nov 2008, 04:58 PM
Hello Paul,

Yes you can override the MinHeight property very easy. Use the following code:
// define the style in a Resource section:  
            <Style x:Key="MyTreeViewItemStyle"  TargetType="telerik:RadTreeViewItem">  
               <Setter Property="MinHeight" Value="5" /> 
           </Style> 
 
// then in the definition of the RadTreeView just set the item container style  
<telerik:RadTreeView ItemContainerStyle="{StaticResource ExpandedItemStyle}" ... 

Please let us know how it goes.

Kind regards,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul
Top achievements
Rank 1
answered on 16 Nov 2008, 07:40 PM

Hello Valentin,

 

Thanks for the response. You solved my problem. However, now I run into another one. I want to make use of the drag and drop features. Therefore I  wired up an eventhandler for the DragEnded event.  The passed RadTreeViewDragEndedEventArgs should contain all info about the event, such as the TargetDropItem. However, In case the DropPosition is Before or After, the TargetDropItem is null. Only if the DropPosition equals to DropPosition.Inside, the TargetDropItem property is provided. Is this a bug or do I overlook something.

Paul

0
Valentin.Stoychev
Telerik team
answered on 17 Nov 2008, 07:13 AM
Hi Paul,

Yes - this is a bug in the current version of the control. Thanks for bringing it up. We will address it with the next release. Your telerik points has been updated.

Best wishes,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Timothy Lee Russell
Top achievements
Rank 2
answered on 09 Jun 2009, 10:57 PM
I am having a big problem with the DropPosition "before" and "after" not returning the TargetDropItem that they are before or after.  Any update on this issue?

Thanks,
Timothy
0
Bobi
Telerik team
answered on 10 Jun 2009, 12:16 PM
Hi Timothy Lee Russell,

 This issue is already added to the last internal build. Please find attached a sample project that demonstrates using treeview with drag/drop functionality.

Please let us know if you still have any other question or difficulties using RadTreeView.

Sincerely yours,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Timothy Lee Russell
Top achievements
Rank 2
answered on 15 Jun 2009, 05:28 AM
Indeed, it is fixed in the latest internal build.

Thanks,
Timothy
Tags
TreeView
Asked by
Paul
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Paul
Top achievements
Rank 1
Timothy Lee Russell
Top achievements
Rank 2
Bobi
Telerik team
Share this question
or