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

Drop won't be called in RadDocking

1 Answer 23 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Li
Top achievements
Rank 1
Li asked on 25 Jan 2014, 09:23 AM
hi~
The issue can be showed in the code below
I have two TextBlocks, the only difference between them is where they are.
but the one inside the RadPane never fires a Drop Event.

xaml:
<Window x:Class="test.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
        <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBlock Name="src" Text="src" Grid.Column="0" PreviewMouseDown="src_PreviewMouseDown"></TextBlock>
        <telerik:RadDocking Grid.Column="1">
            <telerik:RadSplitContainer HorizontalAlignment="Stretch">
            <telerik:RadPaneGroup>
                <telerik:RadPane>
                    <Grid>
                        <TextBlock AllowDrop="True" Background="LightYellow" Text="dst1" Drop="TextBlock_Drop"/>
                    </Grid>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
        <TextBlock AllowDrop="True" Background="LightBlue" Text="dst2" Drop="TextBlock_Drop" Grid.Column="2"/>
    </Grid>
</Window>

code behind:
//using blahblah...
namespace test
{
    public partial class MainWindow : Window
    {
        public MainWindow() {
            InitializeComponent();
        }
        private void TextBlock_Drop(object sender, DragEventArgs e) {
            (sender as TextBlock).Text = "On drop";
        }
        private void src_PreviewMouseDown(object sender, MouseButtonEventArgs e){
            string k = (sender as TextBlock).Text;
            DragDropEffects allowedEffects = DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Link;
            DragDrop.DoDragDrop(sender as TextBlock, k, allowedEffects);
        }
    }
}

1 Answer, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 30 Jan 2014, 07:08 AM
Hi Li,

Instead of using default drop event, you have to use DragDropManager's Drop event and add a handler for it. You can read more information about DragDropManager in our online help.
I've prepared a sample project based on your code and I've added a drop handler that is executed correctly. You can find it attached and give it a try.

Hope this helps.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Li
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Share this question
or