Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
XamDataGrid Hit Test bug
posted

Hi.  I'm trying to do a drag and drop operation with the XamDataGrid.  I'm using a hit test and the PreviewMouseLeftButtonDown event to get the object.  For the most part, it works.  The problem is when the top row isn't the first item, and I drag and drop the first row, it gets the object in the above row instead of the row that was selected. 

 

Here's an example of what I mean:

 

TARGET                   SOURCE

________                   _X_______          <- hidden because it’s already scrolled out of position
|A             |                 |Y                 |        <- drag and drop this one
|B             |                 |Z                 |
|C             |



RESULTS
________
|A             |                                          
|B             |                                           
|C             |                                           
|X             |            <- it gets X instead of Y

 

I included a sample to show the bug.  The project is built using VS2010.

When running the sample, just drag and drop items from the source to the target grid.  The item should get added to the target grid.  If you scroll down on the source grid and drag and drop the item in the first row, it adds the wrong data.

XamDataGridBug.zip