QueryRowDragging detects CurrentRowData type wrong

I have implemented drag and drop with grouping, in general it works fine but I found an error. here is the scenario

assume my data is as below in the datagrid

- Group 1
   -item 1
   -item 2
- Group 2
  - item 1
   - item 2

If I drag and drop group 2 over group 1, for code below  (e.CurrentRowData is Syncfusion.Data.Group)  true , but If I drag group 1 below group 2,   (e.CurrentRowData is Syncfusion.Data.Group)  false because e.CurrentRowData  is returned as type of items, it doesnt return as a group. 

 private async void SfGrid_QueryRowDragging(object sender, QueryRowDraggingEventArgs e)
        {
             if (e.Reason == QueryRowDraggingReason.DragEnded)
                {
                    var data=   e.CurrentRowData;

 

3 Replies

SK Suriya Kalidoss Syncfusion Team April 2, 2018 12:39 PM UTC

Hi Emil, 
 
Thank you for using Syncfusion Products. 
 
We have checked you query. CurrentRowData always returns the corresponding row data, over which the row drag view is currently placed. So while dragging a record from group 2 above the caption row, the drag view has returned the current data as group since it is above the caption row. In the same way, while dragging a row from group 1 below the last record in the group2 drag view is above a record items and hence “CurrentRowData” is returned as the underlying data item.  
 
Please refer the below UG links for more details. 
 
Regards, 
Suriya K 



EM Emil April 2, 2018 05:58 PM UTC

Hi,

sorry this is not the case. if I drag and drop a  GROUP  on any position currentrowdata is always   Syncfusion.Data.Group. If i hold Group 2 and grad over Group 1, it will return type as  Syncfusion.Data.Group but if I drag  group 1 over group 2 it return type of the items which is expected only if drag and drop one of the items. please test it yourself and see the difference.  


SK Suriya Kalidoss Syncfusion Team April 3, 2018 01:17 PM UTC

Hi Emil, 
 
We have analyzed your query. CurrentRowData property does not return the dragging row data rather it displays the row data over which the dragging indicator is placed. RowData property in the event args returns the row data of the row that is long pressed and dragged.  
 
Hence, CurrentRowData always returns the corresponding row data, over which the row drag view is currently placed. For example while dragging group 1 over group 2 CurrentRowData displays the data information about group 2.This is the behavior of CurrentRowData in SfDataGrid. Please let us know if you require further assistance. 
 
Regards, 
Suriya K 


Loader.
Up arrow icon