DragStatus is set to Cancel??

4 posts, 0 answers
  1. Greg
    Greg avatar
    14 posts
    Member since:
    Jun 2008

    Posted 03 Jun 2009 Link to this post

    I am trying to drag an item from a RadTreeView onto a cell in a RadGridView.  I am using the following XAML to set my row styles accordingly:

     

     

     

    1 <UserControl.Resources> 
    2  
    3     <Style TargetType="ctrlTelerikGridView:GridViewRow" x:Key="commonRowStyle">  
    4  
    5         <Setter Property="ctrlTelerikDragDrop:RadDragAndDropManager.AllowDrop" 
    6  
    7         Value="True" />   
    8  
    9     </Style> 
    10  
    11 </UserControl.Resources> 
    12  
    13  

    ....

    1 <ctrlTelerikControls:RadGridView x:Name="TargetsGrid" CanUserReorderColumns="False" ctrlTelerikDragDrop:RadDragAndDropManager.AllowDrop="True" 
    2  
    3  
    4 CanUserFreezeColumns="False" ShowGroupPanel="False" HorizontalAlignment="Left"   
    5  
    6 IsFilteringAllowed="False" AutoGenerateColumns="False" RowIndicatorVisibility="Visible"   
    7  
    8 ColumnsWidthMode="Fill" MultipleSelect="False" ScrollMode="RealTime" Background="White" RowStyle="{StaticResource commonRowStyle}" AlternateExpandableRowStyle="{StaticResource commonRowStyle}" > 
    9  
    10  
    11 <ctrlTelerikControls:RadGridView.Columns> 
    12  
    13  
    14 <ctrlTelerikControls:GridViewDataColumn HeaderText="Target Field" DataMemberPath="TargetFieldName"/>  
    15  
    16  
    17 <ctrlTelerikControls:GridViewDataColumn HeaderText="Type" DataMemberPath="FieldType"/>  
    18  
    19  
    20 <ctrlTelerikControls:GridViewDataColumn HeaderText="Source Field" DataMemberPath="SourceField"/>  
    21  
    22  
    23 </ctrlTelerikControls:RadGridView.Columns>   
    24  
    25 </ctrlTelerikControls:RadGridView> 
    26  
    27  
    However, only the OnDragQuery and OnDropInfo events fire.  What is odd is that the e.Options.Status property is set to "DragCancel" in the OnDragInfo event. 

    Any suggestion on how fix this and get the other events to fire?

     

     

  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 05 Jun 2009 Link to this post

    Hi Greg Case,

    This may be the case if the GridView is in a popup or non-telerik Window that opens in a popup. Popups have a separate visual tree from the main visual tree and they need to be explicitly added to the e.Options.ParticipatingVisualRoots collection during drag query for example.

    Are you using the GridView in a popup or a window?

    Best wishes,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Kjell
    Kjell avatar
    275 posts
    Member since:
    Jun 2010

    Posted 17 Sep 2010 Link to this post

    Hi, I am having the same problem and I am indeed using a popup, what is the solution?
  5. Kjell
    Kjell avatar
    275 posts
    Member since:
    Jun 2010

    Posted 17 Sep 2010 Link to this post

    The solution was to add the following code to the top of the OnDragQuery handler:


    if (!RadDragAndDropManager.Options.ParticipatingVisualRoots.Contains(allUsersBox))
                {
                    RadDragAndDropManager.Options.ParticipatingVisualRoots.Add(allUsersBox);
                }


    I did that for each of my listboxes (I have three).  Then I also had to add a check for null box in the OnDropQuery and onDropInfo handlers.
Back to Top