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

Forward calls to grid from Custom Mouse controller

Is it possible to forward calls back to the grid from a custom mouse controller. i.e. Eg the MouseDown event, is it possible to forward the MouseDown event on to the grid so that normal grid processing may occur? There doesn't appear to be any OnMouseDown methods etc.etc. to do this....

5 Replies

AD Administrator Syncfusion Team October 22, 2003 10:23 PM UTC

Just before the MouseControllers MouseDown is called, the HitTest return value is checked again. So if you check for Control.MouseButtons in HitTest then you could return 0 and the MouseController will not get the MouseDown and the grids default Mouse handler will be called. But if that doesn't work, you could derive from Gridcontrol Class and add public RaiseMouse* method that then call OnMouse*. But you need to be carefull to not start a infinite recursion then, e.g. you need to set a flag in your MouseController's MouseDown that subsquent HitTest calls will return 0. Otherwise when you call OnMouseDown this will end up calling the MouseController's MouseDown method again. Stefan

IO IOMS October 22, 2003 10:24 PM UTC

Actually, it seems like the grid is getting the MouseDown and MouseUp events however, the CellClick event is not called when being handled by the custom mouse controller. Is there any way from the custom mouse controller to ensure that all normal grid events will be fired!

AD Administrator Syncfusion Team October 23, 2003 10:15 AM UTC

In this case, you would want to call grid.RaiseCellClick from within your custom controller if you want the cell click to happen. In general, there is no way to allow 'all' grid mouse events to happen when you have a custom mousecontroller because your controller has control when it returns a nonzero HitTest which means the grid's default controllers don't get a chance at handling the messages at this point.

AD Administrator Syncfusion Team October 23, 2003 11:03 AM UTC

Oops. The RaiseCellClick is new for 2.0, it is not in 1.6. Attached is a 2.0 file that illustrates how you can have your mousecontroller raise particular cell events.

IO IOMS October 23, 2003 09:28 PM UTC

Yeah that looks cool! V2.0 is the way to go - for now I will just create my own methods on my grid. Ta, Marcus

Live Chat Icon For mobile
Up arrow icon