views:

670

answers:

1

I'm trying to implement drag/drop support to a propertygrid in C# using VS2005 (.NET 2.0). The propertygrid can handle the dragenter etc. events, but there doesn't seem to be a way to get the griditem under the pointer during a drag event. The best I've been able to get so far is to use the selectedgriditem property to retrieve a custom propertydescriptor and set the value, but this requires a grid item to already be selected before starting the drag/drop operation.

Has anyone had any luck with implementing this?

Thanks :-)

+3  A: 

If you don't get any joy, you could try SmartPropertyGrid; I have no idea whether it'll work, but it perhaps worth a look. You might even have more joy as a "feature request" from a 3rd-party, since the MS version is pretty-much sealed now that WPF has taken over.

Marc Gravell
Hey thanks for the recommendation, the SmartPropertyGrid is actually pretty cool, and it has the method i needed, PropertyItemFromPoint() to do the drag/drop stuff. Thanks again!
I should add that SPG is commercial, so I'd still be interested if anyone knows how to do this kind of voodoo with the default .NET 2.0 propertygrid :-)