本文整理汇总了C#中GridVirtual.ChangeMouseDownCell方法的典型用法代码示例。如果您正苦于以下问题:C# GridVirtual.ChangeMouseDownCell方法的具体用法?C# GridVirtual.ChangeMouseDownCell怎么用?C# GridVirtual.ChangeMouseDownCell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridVirtual
的用法示例。
在下文中一共展示了GridVirtual.ChangeMouseDownCell方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: grid_MouseDown
protected virtual void grid_MouseDown(GridVirtual sender, System.Windows.Forms.MouseEventArgs e)
{
//verifico che l'eventuale edit sia terminato altrimenti esco
if (sender.Selection.ActivePosition.IsEmpty() == false)
{
CellContext focusCell = new CellContext(sender, sender.Selection.ActivePosition);
if (focusCell.Cell != null && focusCell.IsEditing())
{
if (focusCell.EndEdit(false) == false)
return;
}
}
//scateno eventi di MouseDown
Position position = sender.PositionAtPoint( new Point(e.X, e.Y) );
if (position.IsEmpty() == false)
{
Cells.ICellVirtual cellMouseDown = sender.GetCell(position);
if (cellMouseDown != null)
{
sender.ChangeMouseDownCell(position, position);
//Cell.OnMouseDown
CellContext cellContext = new CellContext(sender, position, cellMouseDown);
sender.Controller.OnMouseDown(cellContext, e);
}
}
else
sender.ChangeMouseDownCell(Position.Empty, Position.Empty);
}
示例2: grid_MouseUp
protected virtual void grid_MouseUp(GridVirtual sender, System.Windows.Forms.MouseEventArgs e)
{
if (sender.MouseDownPosition.IsEmpty() == false)
{
Cells.ICellVirtual l_MouseDownCell = sender.GetCell(sender.MouseDownPosition);
if (l_MouseDownCell!=null)
sender.Controller.OnMouseUp(new CellContext(sender, sender.MouseDownPosition, l_MouseDownCell), e );
sender.ChangeMouseDownCell(Position.Empty, sender.PositionAtPoint(new Point(e.X, e.Y)));
}
}