Drag and Drop enabed ItemsControl with ContextMenu

8 posts, 0 answers
  1. Ogi Ivanov
    Ogi Ivanov avatar
    8 posts
    Member since:
    Feb 2010

    Posted 07 Jun 2010 Link to this post

    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

  2. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 10 Jun 2010 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ogi Ivanov
    Ogi Ivanov avatar
    8 posts
    Member since:
    Feb 2010

    Posted 10 Jun 2010 Link to this post

    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
  5. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 15 Jun 2010 Link to this post

    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.
  6. Ogi Ivanov
    Ogi Ivanov avatar
    8 posts
    Member since:
    Feb 2010

    Posted 16 Jun 2010 Link to this post

    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
  7. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 17 Jun 2010 Link to this post

    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
  8. Brett
    Brett avatar
    14 posts
    Member since:
    Feb 2014

    Posted 14 Jul 2014 Link to this post

    Was this issue ever resolved? I am experiencing the same problem with the latest version of the Telerik dlls.
  9. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 17 Jul 2014 Link to this post

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