Visual Cues on Drag

4 posts, 0 answers
  1. Salvatore
    Salvatore avatar
    3 posts
    Member since:
    May 2011

    Posted 01 Mar 2012 Link to this post

    Is there a way to customize the look of the drag feature? So when you drag an appointment it currently shows you the location you are dragging it to with the times in the corners incidcating the start and end times, as well as the appointment name with an arrow indicator.  Is there a way to remove the times from the dragging?
  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 02 Mar 2012 Link to this post

    Hi,

    You can use the DragVisualTemplate property of type DataTemplate of RadScheduleView to customize the content of the drag visual.

    All the best,
    Rosi
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Salvatore
    Salvatore avatar
    3 posts
    Member since:
    May 2011

    Posted 03 Mar 2012 Link to this post

    Is the source available for the current dragvisualtemplate?  Could I modify the existing template?
  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 05 Mar 2012 Link to this post

    Hello,
    Below is the code for the default value of DragVisualTemplate property
    <DataTemplate x:Key="DragVisualContentTemplate">
        <TextBlock Text="{Binding Converter={StaticResource DraggedAppointmentsToLocalizedStringConverter}}" TextWrapping="Wrap" MaxWidth="200" MaxHeight="66" TextTrimming="WordEllipsis" />
    </DataTemplate>

    You can also use the DragDropHighlightStyle property to customize the drag highlight.Its default value is:
    <Style x:Key="DragDropHighlightStyle" TargetType="scheduleView:HighlightItem">
        <Setter Property="Background" Value="{StaticResource DecorationRectangleBackground_DragOver}" />
        <Setter Property="BorderBrush" Value="{StaticResource DecorationRectangleOuterBorder_DragOver}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Border BorderBrush="{StaticResource DecorationRectangleInnerBorder_DragOver}" BorderThickness="1" />
                            <Path Width="8" Height="8" Margin="-2" HorizontalAlignment="Left" VerticalAlignment="Top" Stroke="{StaticResource AppointmentResizeCueTopLeftMarkStroke}">
                                <Path.Data>
                                    <GeometryGroup>
                                        <EllipseGeometry RadiusX="2" RadiusY="2" Center="2 2" />
                                        <LineGeometry StartPoint="3 3" EndPoint="8 8" />
                                    </GeometryGroup>
                                </Path.Data>
                            </Path>
     
                            <TextBlock x:Name="StartTextBox" Margin="4 2" Foreground="{StaticResource RadScheduleForeground}" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding ActualStart,StringFormat=t}" />
     
                            <Path Width="8" Height="8" Margin="-2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Stroke="{StaticResource AppointmentResizeCueBottomRightMarkStroke}">
                                <Path.Data>
                                    <GeometryGroup>
                                        <EllipseGeometry RadiusX="2" RadiusY="2" Center="6 6" />
                                        <LineGeometry StartPoint="0 0" EndPoint="5 5" />
                                    </GeometryGroup>
                                </Path.Data>
                            </Path>
                            <TextBlock x:Name="EndTextBox" Margin="4 2" Foreground="{StaticResource RadScheduleForeground}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Text="{Binding ActualEnd,StringFormat=t}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    All the best,
    Rosi
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top