I am trying to get the correct drag and drop ContainerListViewItem.
I was using this code successfully to get the drag and drop item. I adjusted the Y point to take into account the header height as without it GetItemAt was returning the node below the one I dropped onto...
protected override void OnDragDrop(WinForms.DragEventArgs e)
{
Point point = this.PointToClient(new Point(e.X, e.Y));
ContainerListViewItem listViewItem = GetItemAt(point.Y - this.HeaderHeight);
...
}
I deployed this code to a number of machines and now find that in certain machines it goes into an almost random folder. I cannot tell if it is an operating system issue, .Net framework version, screen resolution etc.
On the effected machines the following returns the correct item...
GetItemAt(point.Y);
Can someone please tell me what is the correct way to get the screen coordinates to pass into the GetItemAt method or give me an idea as to what might be causing this issue.
I hope you can help. Thank you very much for a great control.
Kind regards,
John O'Gorman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This was happening as a scroll bar was showing that threw out the Y coordinate. I had modify the library to allow access to the vscrollbar and include its value in the GetItemAt calculation...
Hello,
I am trying to get the correct drag and drop ContainerListViewItem.
I was using this code successfully to get the drag and drop item. I adjusted the Y point to take into account the header height as without it GetItemAt was returning the node below the one I dropped onto...
protected override void OnDragDrop(WinForms.DragEventArgs e)
{
Point point = this.PointToClient(new Point(e.X, e.Y));
ContainerListViewItem listViewItem = GetItemAt(point.Y - this.HeaderHeight);
...
}
I deployed this code to a number of machines and now find that in certain machines it goes into an almost random folder. I cannot tell if it is an operating system issue, .Net framework version, screen resolution etc.
On the effected machines the following returns the correct item...
GetItemAt(point.Y);
Can someone please tell me what is the correct way to get the screen coordinates to pass into the GetItemAt method or give me an idea as to what might be causing this issue.
I hope you can help. Thank you very much for a great control.
Kind regards,
John O'Gorman
Hello,
This was happening as a scroll bar was showing that threw out the Y coordinate. I had modify the library to allow access to the vscrollbar and include its value in the GetItemAt calculation...
GetItemAt(point.Y - this.HeaderHeight + VScrollBar.Value)
JP