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

    Hi,

    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
    Admin
    Martin avatar
    1101 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}">
                <Grid>
                    <ScrollViewer
                                    Padding="{TemplateBinding Padding}"
                                    IsTabStop="False"
                                    x:Name="ScrollViewer"
                                    BorderThickness="0"
                                    Background="{x:Null}"
                                    CanContentScroll="True"
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Auto">
                        <ItemsPresenter/>
                    </ScrollViewer>
                    <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"/>
                        </Grid>
                    </Canvas>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>

    I hope this helps.

    Regards,
    Martin
    Telerik
     
    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top