[]
        
(Showing Draft Content)

C1.Win.C1FlexGrid.C1FlexGridBase.BeforeMouseDown

BeforeMouseDown Event

Fires before the MouseDown event is handled by the grid.

Namespace: C1.Win.C1FlexGrid
Assembly: C1.Win.C1FlexGrid.4.8.dll
Syntax
public event BeforeMouseDownEventHandler BeforeMouseDown
Returns
Type Description
BeforeMouseDownEventHandler Fires before the event is handled by the grid.
Remarks

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.

Examples

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