Skip to content

Commit

Permalink
Merge pull request #30 from unvell/fix/selectionMovedBackwardEventSho…
Browse files Browse the repository at this point in the history
…uldBeFired

Fix/selection moved backward event should be fired
  • Loading branch information
jingwood authored Jul 30, 2017
2 parents 1f3924f + 94994c4 commit 58f21e1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
10 changes: 5 additions & 5 deletions ReoGrid/Core/Worksheet/Selection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ public void MoveSelectionForward()
{
if (SelectionMovedForward != null)
{
var arg = new SelectionMoveForwardEventArgs();
var arg = new SelectionMovedForwardEventArgs();
SelectionMovedForward(this, arg);
if (arg.IsCancelled)
{
Expand Down Expand Up @@ -1125,8 +1125,8 @@ public void MoveSelectionBackward()
{
if (SelectionMovedBackward != null)
{
var arg = new SelectionMoveForwardEventArgs();
SelectionMovedForward(this, arg);
var arg = new SelectionMovedBackwardEventArgs();
SelectionMovedBackward(this, arg);
if (arg.IsCancelled)
{
return;
Expand Down Expand Up @@ -1477,12 +1477,12 @@ public void MoveSelectionPageUp(bool appendSelect = false)
/// <summary>
/// Event raised when focus-selection move to next position
/// </summary>
public event EventHandler<SelectionMoveForwardEventArgs> SelectionMovedForward;
public event EventHandler<SelectionMovedForwardEventArgs> SelectionMovedForward;

/// <summary>
/// Event raised when focus-selection move to previous position
/// </summary>
public event EventHandler<SelectionMoveForwardEventArgs> SelectionMovedBackward;
public event EventHandler<SelectionMovedBackwardEventArgs> SelectionMovedBackward;

#endregion // Events
}
Expand Down
35 changes: 27 additions & 8 deletions ReoGrid/EventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,22 +867,41 @@ public ExceptionHappenEventArgs(Worksheet sheet, Exception exception)
#region Selection

/// <summary>
/// Event raised when selection will move to another position.
/// ReoGrid automatically move the selection to 'Right' or 'Down' according
/// to 'SelectionForwardDirection' property of control.
/// Event raised when selection moved to next position.
/// ReoGrid automatically move selection to right cell or below cell according
/// to <code>SelectionForwardDirection</code> property of worksheet.
/// </summary>
public class SelectionMoveForwardEventArgs : EventArgs
public class SelectionMovedForwardEventArgs : EventArgs
{
/// <summary>
/// Decide whether to cancel current operation
/// Decide whether to cancel current move operation.
/// </summary>
public bool IsCancelled { get; set; }

/// <summary>
/// Create instance for SelectionMoveForwardEventArgs with specified
/// position.
/// Create instance of SelectionMovedForwardEventArgs with specified position.
/// </summary>
public SelectionMoveForwardEventArgs()
public SelectionMovedForwardEventArgs()
{
}
}

/// <summary>
/// Event raised when selection moved to previous position.
/// ReoGrid automatically move selection to left cell or above cell according
/// to <code>SelectionForwardDirection</code> property of worksheet.
/// </summary>
public class SelectionMovedBackwardEventArgs : EventArgs
{
/// <summary>
/// Decide whether to cancel current move operation.
/// </summary>
public bool IsCancelled { get; set; }

/// <summary>
/// Create instance of SelectionMovedBackwardEventArgs with specified position.
/// </summary>
public SelectionMovedBackwardEventArgs()
{
}
}
Expand Down

0 comments on commit 58f21e1

Please sign in to comment.