RadTreeView - Amend drop preview line

2 posts, 0 answers
  1. Ian
    Ian avatar
    7 posts
    Member since:
    Jun 2014

    Posted 26 Jun 2014 Link to this post


    Is there any way to customize the drop preview line: (the orange line with the circle on one end in the attached image)

    I'd like to change the color to be more prominent in our system here, but I can't figure out how to change it?

    Thanks very much
  2. Martin Ivanov
    Martin Ivanov avatar
    1387 posts

    Posted 26 Jun 2014 Link to this post

    Hi Ian,

    As the preview line is set directly in the RadTreeView's ControlTemplate in order to change its color you will need to slightly change the template. Basically after extracting the template you can find the Canvas element with x:Name set to "DragBetweenItemsFeedback" and change the colors of the elements inside its Content.

    For your convenience I extracted the ControlTemplate and prepared a sample project that demonstrates this change.
    <ControlTemplate x:Key="treeViewTemplate" TargetType="telerik:RadTreeView">
        <Grid x:Name="RootElement">
            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                                    Padding="{TemplateBinding Padding}"
                    <Canvas x:Name="DragBetweenItemsFeedback" Height="8" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="False">
                        <Ellipse Stroke="Green" StrokeThickness="2" Width="8" Height="8"/>
                        <Grid Width="{Binding ElementName=DragBetweenItemsFeedback, Path=Width}">
                            <Rectangle Fill="Green" RadiusX="2" RadiusY="2" Height="2" Margin="6,3,0,3"/>

    I hope this helps.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top