This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
When the column header height is greater than the height of the grouping panel (I think) the drop indicator may not be hidden when the drop on the grouping panel is completed. Here is an example of what I am seeing after the drop to the grouping panel: The code to repro this is below. This does depend on how the user maneuvers the mouse. To see this problem in the repro drag the Address column to the left until the column drop indicator appears, and then up to the grouping panel. Hopefully you can see what I am seeing (I think there is a small chance that this is framework dependent--I am using 4.0). I think I have diagnosed the problem, but not the solution: There are two places in DataGridHeaderRowPresenter with the line of code "Point position = e.GetPosition(this);". In OnDragOver I inserted the line
and in OnDragLeave
Here is what I see in the Output window as I drag left then up OnDragOver X=395.00,Y=10.04,W=508.00,H=39.00 OnDragOver X=391.00,Y=10.04,W=508.00,H=39.00 OnDragOver X=388.00,Y=10.04,W=508.00,H=39.00 OnDragOver X=384.00,Y=9.04,W=508.00,H=39.00 OnDragOver X=381.00,Y=9.04,W=508.00,H=39.00 OnDragOver X=379.00,Y=9.04,W=508.00,H=39.00 OnDragLeave X=456.25,Y=10.04,W=508.00,H=39.00 OnDragOver X=377.00,Y=9.04,W=508.00,H=39.00 OnDragOver X=376.00,Y=8.04,W=508.00,H=39.00 (omitted similar lines) OnDragOver X=301.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=300.00,Y=8.04,W=508.00,H=39.00 OnDragLeave X=300.00,Y=8.04,W=508.00,H=39.00 OnDragLeave X=307.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=296.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=295.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=294.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=293.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=292.00,Y=8.04,W=508.00,H=39.00 OnDragLeave X=379.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=287.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=285.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=283.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=281.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=280.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=279.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=278.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=277.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=276.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=275.00,Y=8.04,W=508.00,H=39.00 OnDragLeave X=249.58,Y=7.04,W=508.00,H=39.00 OnDragOver X=273.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=272.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=271.00,Y=8.04,W=508.00,H=39.00 (omitted similar lines) OnDragOver X=235.00,Y=8.04,W=508.00,H=39.00 OnDragOver X=235.00,Y=7.04,W=508.00,H=39.00 OnDragOver X=234.00,Y=6.04,W=508.00,H=39.00 OnDragOver X=232.00,Y=6.04,W=508.00,H=39.00 OnDragOver X=231.00,Y=6.04,W=508.00,H=39.00 OnDragOver X=229.00,Y=5.04,W=508.00,H=39.00 OnDragOver X=228.00,Y=4.04,W=508.00,H=39.00 OnDragOver X=227.00,Y=4.04,W=508.00,H=39.00 OnDragOver X=227.00,Y=3.04,W=508.00,H=39.00 OnDragOver X=225.00,Y=3.04,W=508.00,H=39.00 OnDragLeave X=248.42,Y=3.04,W=508.00,H=39.00 OnDragOver X=223.00,Y=1.04,W=508.00,H=39.00 OnDragOver X=222.00,Y=1.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=1.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=1.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragOver X=220.00,Y=0.04,W=508.00,H=39.00 OnDragLeave X=420.00,Y=30.00,W=508.00,H=39.00 Note that at the end Y is decreasing as I drag up towards the grouping panel. However, as it crosses from the top of the DataGridHeaderRowPresenter to the bottom of the grouping panel, the Y does not become negative in the final OnDragLeave as I think both of us would expect. Instead Y jumps up to 30 (the approximate height of the grouping panel), which causes the following test on position.Y to fail, so IsRequestingColumnDropPosition never gets reset to false (see source code). It appears to me that GetPosition(this) is ignoring the "this". Seems very strange to me. When the column header height is less than the height of the grouping panel the IsRequestingColumnDropPosition does get set false only because position.Y is greater than ActualHeight. In the repro code I think the only important thing to reproduce this problem is to set the header height somewhat greater than the height of the grouping panel. Here is the XAML to reproduce
Note that I have set the height of the DataTemplate to 35, which is greater than the height of the grouping panel (31 according to snoop) . Here is the C# (not very interesting in this case)
|
|
|
Hello Peter Thanks for all the information about this strange issue. e.GetPosition and Mouse.GetPosition are unreliable during Drag/Drop operations (and other scenarios), so in the next nightly build, both DataGridHeaderRowPresenter and DataGridGroupingRow will use a P/Invoke to get a 100% reliable mouse position and solve the issue. -Jason Fauchelle |
|