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.
Unfortunately, activation email could not send to your email. Please try again.

Forward calls to grid from Custom Mouse controller

Thread ID:

Created:

Updated:

Platform:

Replies:

8148 Oct 22,2003 05:55 PM Oct 23,2003 05:28 PM Windows Forms 5
loading
Tags: GridControl
IOMS
Asked On October 22, 2003 05:55 PM

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....

Administrator [Syncfusion]
Replied On October 22, 2003 06: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. Stefan

IOMS
Replied On October 22, 2003 06: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!

Administrator [Syncfusion]
Replied On October 23, 2003 06: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.

Administrator [Syncfusion]
Replied On October 23, 2003 07: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.

IOMS
Replied On October 23, 2003 05: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. Ta, Marcus

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;