Problem using dragdrop with datagrid
Posted on 2005-03-31
I have two datagrids that are on a form and i want to drag from one datagrid (1), which is on the right of the screen to the other datagrid (2). which is on the left of the screen
The problem i am getting is that when i drag an item from datagrid (1) and drop it on to datagrid(2). The hittestinfo givesw me the row and column for datagrid(1) even though i am not dropping on it.
The code to get the hittestinfo is simple:
Dim hti2 As DataGrid.HitTestInfo
Dim pt As Point
pt = New Point(e.X, e.Y)
Dim myGrid As DataGrid = CType(sender, DataGrid)
hti2 = myGrid.HitTest(PointToClient(pt))
If you were to imagine a horizontal grid accross the screen, wherever i drop the item on datagrid(2), it gives me the corresponding column and row from datagrid(1) if you were to follow the horizontal line.
Oh yea, the two datagrids are user controls that inherit the datagrid windows control.