Posted 26 September 2018, 6:12 pm EST
Hi, I need to manage drag&drop to flexgrid row instead of flexfrid.
Actually im using the flexgrid in tree view, but it’s usefull in general.
How can I have the row reference in the drop event?
Thank you
Forums Home / ComponentOne / WPF Edition
Posted by: kisar on 26 September 2018, 6:12 pm EST
Posted 26 September 2018, 6:12 pm EST
Hi, I need to manage drag&drop to flexgrid row instead of flexfrid.
Actually im using the flexgrid in tree view, but it’s usefull in general.
How can I have the row reference in the drop event?
Thank you
Posted 27 September 2018, 8:49 pm EST
Hello,
I am not sure I understand your requirement to the fullest. Therefore, I would request you to elaborate a bit more on your requirement.
Mean-while, I would suggest you to refer the following blog that shows how to drag drop rows between TreeView and C1FlexGrid and also teaches on how to access the row being dropped.
Blog URL: https://www.grapecity.com/en/blogs/how-to-drag-and-drop-items-between-controls
Thanks,
Ruchir
Posted 28 September 2018, 11:59 pm EST
Thank you i’ll,
however my need is very simple,
I need to know in wich row I’m dropping
Thanx
Posted 30 September 2018, 9:39 pm EST
Hello,
For getting the row on which item is being dropped, one easy way is to use C1DragDropManager and use its DragDrop event. This event provides the position of the drop (e.GetPosition(flexGrid)), you can use this position to HitTest FlexGrid as follows:```
// get target row
var ht = SampleGrid.HitTest(e.GetPosition(SampleGrid));
if(ht.Row!=-1)
{
var rowData= SampleGrid.Rows[ht.Row].DataItem;
}
Regards,
Ruchir