Modifying style of RadTreeViewItems

7 posts, 0 answers
  1. Paul
    Paul avatar
    2 posts
    Member since:
    Nov 2008

    Posted 10 Nov 2008 Link to this post

    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
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 11 Nov 2008 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Paul
    Paul avatar
    2 posts
    Member since:
    Nov 2008

    Posted 16 Nov 2008 Link to this post

    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

  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 17 Nov 2008 Link to this post

    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.
  6. Timothy Lee Russell
    Timothy Lee Russell avatar
    20 posts
    Member since:
    Feb 2003

    Posted 09 Jun 2009 Link to this post

    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
  7. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 10 Jun 2009 Link to this post

    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.
  8. Timothy Lee Russell
    Timothy Lee Russell avatar
    20 posts
    Member since:
    Feb 2003

    Posted 15 Jun 2009 Link to this post

    Indeed, it is fixed in the latest internal build.

    Thanks,
    Timothy
Back to Top
UI for WPF is Visual Studio 2017 Ready