I have two problem,
Is there some method to Drag & drop only in parent gridview self and Hierarchy gridview self?
can we Drag & drop only between p1,p2,p3 for order
and Drag & drop only between sub1 sub2 sub3…
Is there some method to Drag & drop only in parent gridview self and gridview in RowDetailsTemplate self?
It is a big forever If you can provide a sample! thanks a lot!!
7 Answers, 1 is accepted
In general, this requirement can be achieved by setting the AllowDrop property of a given GridViewRow to "False". I suggest you taking a look at the Drag and Drop within RadGridView help topic. If you review the
OnRowDragOver event handler method, you will notice that the sender object is the currently dragged row. So, you can implement custom logic depending on whether a given row is an item of the parent collection or the child one, and set its AllowDrop property as per your requirements.
Hope this helps.
All the best,
Hello Stefan X1 ,
I looked at the Drag and Drop within RadGridView topic and it worked well in one GridView,and try to setting the AllowDrop property in OnRowDragOver event handler method in Hierarchy gridview by HierarchyChildTemplate,but it did not work fine, may be I set it to a wrong way,can you provide a sample? thanks a lot!!
Can you please share some details on the difficulties you are experiencing at your end? Basically, you need to set the AllowDrop property of the hierarchical grid to "True" and apply a Style targeting its GridViewRow elements that sets the AllowDrag property to "True". You need to also ensure, that you have enabled the RowReorderBehavior for the hierarchical grid, as demonstrated in the article I referred to in my previous post.
You can also check out the relevant SDK Example using the SDK Samples Browser.
Hello Stefan X1,
I tried to set the AllowDrop property and set row AllowDrop property in OnRowDragOver event,
there's no DropPositionFeedback when I DragOver a child to anther child, but it can be shown when I drag a parent to anther parent.
here is my xaml code:
Can you please clarify whether you are referring to the symbol appearing over a given element, to which the drop operation is disabled? If this is the case, please note, that if the AllowDrop property is correctly set to a given GridViewRow, this symbol would appear automatically. Basically, within the DragOver event handler, you can use the DataContext of a given GridViewRow to determine whether the item is from the child or the parent collection, thus set the AllowDrop property accordingly.
I have a similar problem like Wang. I am developing a control which contains a GridView. Some of the items can have sub items which are assigned to another GridView which is the HierarchyChildTemplate of the main GridView.
How can I implement a drag and drop functionality between the main GridView and the child GridView and vice versa.
I answered your question in the other forum thread that you have opened: DragDrop between GridView and child GridView in HierachyChildTemplate.