Is it possible to forward calls back to the grid from a custom mouse controller.
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....
ADAdministrator Syncfusion Team October 22, 2003 05:23 PM
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.
IOIOMSOctober 22, 2003 05:24 PM
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!
ADAdministrator Syncfusion Team October 23, 2003 05:15 AM
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.
ADAdministrator Syncfusion Team October 23, 2003 06:03 AM
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.
IOIOMSOctober 23, 2003 04:28 PM
Yeah that looks cool!
V2.0 is the way to go - for now I will just create my own methods on my grid.