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

Drag and Drop enabed ItemsControl with ContextMenu

7 Answers 251 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Ogi Ivanov
Top achievements
Rank 1
Ogi Ivanov asked on 07 Jun 2010, 06:19 PM
Hi,
I'm working on a WPF desktop application using RadControls for WPF version 2010.1.0603.35.
I have a number of ListView and RadTreeView controls that are Drag and Drop enabled. They also have a RadContextMenu. The problem I have is when I right click on an item then immediately left click the same or another item in the control. This seems to enable drag and drop and sometimes move items around. In order to reproduce this I used the Demo solution installed with the Telerik product. I took the DragAndDrop TreeToGrid example and I added a RadContextMenu to the ListBox and the RadTreeView as shown below.
<nav:RadTreeView x:Name="allProductsView" 
        ItemTemplateSelector="{StaticResource ExampleTemplateSelector}" 
        ItemContainerStyle="{StaticResource TreeViewItemStyle}" 
        IsDragDropEnabled="True" Background="White" BorderThickness="1" 
        BorderBrush="LightGray"   
        Padding="16">  
    <telerikNavigation:RadContextMenu.ContextMenu> 
        <telerikNavigation:RadContextMenu > 
            <telerikNavigation:RadMenuItem Header="RadTreeView Menu 1" /> 
            <telerikNavigation:RadMenuItem Header="RadTreeView Menu 2"  /> 
        </telerikNavigation:RadContextMenu> 
    </telerikNavigation:RadContextMenu.ContextMenu> 
</nav:RadTreeView> 
 
<ListBox x:Name="wishlistView" Grid.Column="2" 
        telerik:StyleManager.Theme="Office_Black" SelectionMode="Extended" 
        dragDrop:RadDragAndDropManager.AllowDrop="True" 
        ItemTemplate="{StaticResource WishlistProduct}" 
        ItemContainerStyle="{StaticResource WishlistItemStyle}" Padding="16" > 
    <telerikNavigation:RadContextMenu.ContextMenu> 
        <telerikNavigation:RadContextMenu > 
            <telerikNavigation:RadMenuItem Header="ListBox Menu 1" /> 
            <telerikNavigation:RadMenuItem Header="ListBox Menu 2"  /> 
        </telerikNavigation:RadContextMenu> 
    </telerikNavigation:RadContextMenu.ContextMenu> 
</ListBox> 
Using this example you can right-click on any item under Wishlist and then immediately left-click on a different item under the same control. The items will most likely shuffle around. In any case (on the RadTreeView also) it will enable the drag and drop event and that is not desirable functionality for me.

Your help is very much appreciated.

Thank you,
Ogi Ivanov

7 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 10 Jun 2010, 02:44 PM
Hi Ogi Ivanov,

I've just try it and couldn't reproduce the issue. Can please find the attached project and modify it, so we can reproduce it.
Thank you.

Kind regards,
Miro Miroslavov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ogi Ivanov
Top achievements
Rank 1
answered on 10 Jun 2010, 03:53 PM
Hi Miro,
Thank you for the prompt response.
I cannot reproduce this issue in Silverlight either. Howerver I created a new Windows WPF Applicaton project in the same solution and copied all the code from the Silverlight project. When I run it I can reproduce the issue.

Thank you,
Ogi
0
Miro Miroslavov
Telerik team
answered on 15 Jun 2010, 11:31 AM
Hi Ogi Ivanov,

Now we reproduce it. This is unexpected behavior and I've created work item for it. You may track it's state thought our PITS system.
Thank you.

Regards,
Miro Miroslavov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ogi Ivanov
Top achievements
Rank 1
answered on 16 Jun 2010, 08:14 PM
Hi Miro,
Thank you very much for addressing this issue. I just need to know how long approximately it would take to fix it and would it make a difference if I submit it as a support ticket.

Regards,
Ogi
0
Miro Miroslavov
Telerik team
answered on 17 Jun 2010, 09:57 AM
Hi Ogi Ivanov,

We already have the issue in our bug system, so you don't need to create support ticket. But I can not estimate it right now, you can rise it's priority by voting on the Pits system, once the bug is available there (could take about day).
Sorry for any inconvenience.

Best wishes,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Brett
Top achievements
Rank 1
answered on 15 Jul 2014, 01:20 AM
Was this issue ever resolved? I am experiencing the same problem with the latest version of the Telerik dlls.
0
Martin Ivanov
Telerik team
answered on 17 Jul 2014, 03:02 PM
Hi Brett,

You can find the reported bug logged in our feedback portal, where you can track its status and vote for its fix. If you follow the feedback item you will be notified by email each time its status is changed. I also updated your Telerik points as a small sing of compensation for the inconvenience caused.

As a workaround for the issue you can subscribe for the Opening and Closed events of the RadContextMenu and turn off and on the treeview drag/drop logic when you open/close the menu. Here is an example:
private void RadContextMenu_Opening(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    this.allProductsView.IsDragDropEnabled = false;
}
 
private void RadContextMenu_Closed(object sender, RoutedEventArgs e)
{
    Dispatcher.BeginInvoke(new Action( () =>
    this.allProductsView.IsDragDropEnabled = true));
}
....
<telerik:RadContextMenu.ContextMenu>
    <telerik:RadContextMenu Opening="RadContextMenu_Opening" Closed="RadContextMenu_Closed">
        <telerik:RadMenuItem Header="RadTreeView Menu 1" />
        <telerik:RadMenuItem Header="RadTreeView Menu 2"  />
    </telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>

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.
 
Tags
DragAndDrop
Asked by
Ogi Ivanov
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Ogi Ivanov
Top achievements
Rank 1
Brett
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or