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

DragStatus is set to Cancel??

3 Answers 66 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 03 Jun 2009, 07:24 PM
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:

 

 

 

<UserControl.Resources> 
 
    <Style TargetType="ctrlTelerikGridView:GridViewRow" x:Key="commonRowStyle">  
 
        <Setter Property="ctrlTelerikDragDrop:RadDragAndDropManager.AllowDrop" 
 
        Value="True" />   
 
    </Style> 
 
</UserControl.Resources> 
 
 

....

<ctrlTelerikControls:RadGridView x:Name="TargetsGrid" CanUserReorderColumns="False" ctrlTelerikDragDrop:RadDragAndDropManager.AllowDrop="True" 
 
 
CanUserFreezeColumns="False" ShowGroupPanel="False" HorizontalAlignment="Left"   
 
IsFilteringAllowed="False" AutoGenerateColumns="False" RowIndicatorVisibility="Visible"   
 
ColumnsWidthMode="Fill" MultipleSelect="False" ScrollMode="RealTime" Background="White" RowStyle="{StaticResource commonRowStyle}" AlternateExpandableRowStyle="{StaticResource commonRowStyle}" > 
 
 
<ctrlTelerikControls:RadGridView.Columns> 
 
 
<ctrlTelerikControls:GridViewDataColumn HeaderText="Target Field" DataMemberPath="TargetFieldName"/>  
 
 
<ctrlTelerikControls:GridViewDataColumn HeaderText="Type" DataMemberPath="FieldType"/>  
 
 
<ctrlTelerikControls:GridViewDataColumn HeaderText="Source Field" DataMemberPath="SourceField"/>  
 
 
</ctrlTelerikControls:RadGridView.Columns>   
 
</ctrlTelerikControls:RadGridView> 
 
 
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?

 

 

3 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 05 Jun 2009, 11:54 AM
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.
0
Kjell
Top achievements
Rank 1
answered on 17 Sep 2010, 07:18 PM
Hi, I am having the same problem and I am indeed using a popup, what is the solution?
0
Kjell
Top achievements
Rank 1
answered on 17 Sep 2010, 07:36 PM
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.
Tags
DragAndDrop
Asked by
Greg
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or