[]
Fires before the MouseDown event is handled by the grid.
public event BeforeMouseDownEventHandler BeforeMouseDown
Type | Description |
---|---|
BeforeMouseDownEventHandler | Fires before the event is handled by the grid. |
This event fires before the grid processes the MouseDown event, and gives the program a chance to customize the behavior of the control and optionally cancel the default handling of the mouse.
The code below handles the BeforeMouseDown event to detect clicks on row headers and provide OLE drag and drop functionality.
void _flex_BeforeMouseDown(object sender, BeforeMouseDownEventArgs e)
{
// start dragging when the user clicks the row headers
HitTestInfo hti = _flex.HitTest(e.X, e.Y);
if (hti.Type == HitTestTypeEnum.RowHeader)
{
e.Cancel = true; // cancel default handling
HandleRowDragDrop(hti.Row); // handle row drag/drop
}
}