We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change the color of the drag & drop dotted rectangle with own mouse controller

Hi,
My problem : I want to change the color of the target dotted rectangle which appears when you drag the cell. I want to use my own mouse controller.

I have posted this question already, but the answer I have got was not helpfull enough.

I am looking for the following code sample :
MouseController\GridDragSelectMouseController.cs
Can you send me the sample, or a link to it?

Thank you!
Regards Dan Dusek

3 Replies

HA haneefm Syncfusion Team May 31, 2007 10:06 PM UTC

Hi Dan,

Here is a minimal sample that show you "How to change the drag and drop dotted rectangle with own mouse controller?" . Please try the attached sample and let me know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/ChangeCursorANDDragRectangle/main.htm

Best regards,
Haneef


DD Daniel Dusek June 1, 2007 03:08 PM UTC

Hi Haneef,
thank you sor far for your help.
I use my own mouse controller. The drag&drop cursor has to have a different color, so in the HitTest the position of the mouse cursor is tested and if it is on the position, where the grids drag&drop cursor would appear normally, my new cursor apperes.

But then I need that the drag&drop operation starts (I just changed the D&D cursor, but the D&D operation must be performed). It does not work in your example es well. If the custom leaf-cursor appears, then the cell can't be dragged. The drag&drop events are not cached by the mouse controller. How can I handle this? Can/should I call the drag&drop operation of the grid from my mouse controller?

So once more my problem : I need to change the drag&drop mouse cursor to my own (this is done already), then to perform normal drag&drop operation (does not work at all) and during dragging, I need that the color of the target rectangle is changed to more visible color (red).

Thank you, regards Dan


HA haneefm Syncfusion Team June 1, 2007 11:59 PM UTC

Hi Dan,

One way you can do this by derving the GridDragSelectMouseController class and overide cursur property to change the your cursur. You would have to remove the old controller and register your derived one with code like:

IMouseController controller = this.grid.MouseControllerDispatcher.Find("DragSelect");
this.grid.MouseControllerDispatcher.Remove(controller);
this.grid.MouseControllerDispatcher.Add(new MyGridDragSelectMouseController(this.grid));

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon