Class GridMouseController
Implements the IMouseController interface to be used with MouseControllerDispatcher.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public abstract class GridMouseController : GridSubComponent, IDisposable, IMouseController, IGridFocusHelper
Remarks
Any Mouse Controller needs to implement the IMouseController interface.
In its implementation of MouseController.HitTest, the mouse controller should determine whether your controller wants to handle the mouse events based current context.
See MouseControllerDispatcher for further discussion.
Constructors
GridMouseController(GridControlBase)
Initializes a new GridMouseController and attaches it to a grid.
Declaration
protected GridMouseController(GridControlBase grid)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | grid | The grid control |
Properties
Cursor
Gets the cursor to be displayed.
Declaration
public abstract Cursor Cursor { get; }
Property Value
Type |
---|
System.Windows.Forms.Cursor |
Name
Gets the name of this mouse controller.
Declaration
public abstract string Name { get; }
Property Value
Type |
---|
System.String |
Methods
CancelMode()
CancelMode is called for the active controller after a MouseDown message when the mouse operation is cancelled.
Declaration
public abstract void CancelMode()
GetAllowFixFocus()
Override this method in your GridMouseController and return False if it would interfere with your controller's state when the current cell would be focused and possibly scrolled into view.
Declaration
public virtual bool GetAllowFixFocus()
Returns
Type | Description |
---|---|
System.Boolean | A System.Boolean (True by default) that indicates if the grid is allowed to set the focus onto the current cells System.Windows.Forms.Control. |
HitTest(MouseEventArgs, IMouseController)
HitTest is called to determine whether your controller wants to handle the mouse events based current context.
Declaration
public abstract int HitTest(MouseEventArgs mouseEventArgs, IMouseController controller)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | mouseEventArgs | A System.Windows.Forms.MouseEventArgs holding event data.. |
IMouseController | controller | A IMouseController that has indicated to handle the mouse event. |
Returns
Type | Description |
---|---|
System.Int32 | A non-zero value if the button can and wants to handle the mouse event; 0 if the mouse event is unrelated for this button. |
Remarks
The current winner of the vote is specified through the controller parameter. Your implementation of HitTest can decide if it wants to override the existing vote or leave it.
MouseDown(MouseEventArgs)
MouseDown is called when this controller signaled in HitTest that it wants to handle mouse events and the user pressed the mouse button.
Declaration
public abstract void MouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs holding event data. |
Remarks
MouseDown is called and this controller will become the active controller and receive all subsequent mouse message until the mouse button is released or the mouse operation is cancelled.
MouseHover(MouseEventArgs)
MouseHover is called when this controller signaled in HitTest that it wants to handle mouse events. MouseHover is called after MouseHoverEnter.
Declaration
public abstract void MouseHover(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs holding event data. |
MouseHoverEnter()
MouseHoverEnter is called when this controller signaled in HitTest that it wants to handle mouse events. MouseHoverEnter is called before the first time MouseHover is called.
Declaration
public abstract void MouseHoverEnter()
MouseHoverLeave(EventArgs)
MouseHoverLeave is called when hovering ends either because user dragged mouse out of the hit-test area or when context changes (e.g. user pressed the mouse button).
Declaration
public abstract void MouseHoverLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A System.EventArgs holding event data. |
MouseMove(MouseEventArgs)
MouseMove is called for the active controller after a MouseDown message when the user moves the mouse pointer.
Declaration
public abstract void MouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs holding event data. |
MouseUp(MouseEventArgs)
MouseUp is called for the active controller after a MouseDown message when the user releases the mouse button.
Declaration
public abstract void MouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs holding event data. |