Spread Windows Forms 10.0 Product Documentation
SelectionChanging Event
Example 


Occurs when the selection of cells on the sheet is changing.
Syntax
'Declaration
 
Public Event SelectionChanging As SelectionChangingEventHandler
'Usage
 
Dim instance As FpSpread
Dim handler As SelectionChangingEventHandler
 
AddHandler instance.SelectionChanging, handler
public event SelectionChangingEventHandler SelectionChanging
Event Data

The event handler receives an argument of type SelectionChangingEventArgs containing data related to this event. The following SelectionChangingEventArgs properties provide information specific to this event.

PropertyDescription
CancelGets or sets whether the selection action should be cancelled.  
CurrentColumnGets the column index of the cell that contains the mouse pointer.  
CurrentRowGets the row index of the cell that contains the mouse pointer.  
RangeGets the range of cells encompassing the selection.  
ViewGets the view that contains the selection.  
Remarks

This event is raised by the OnSelectionChanging method when the sheet selection is changing.

For more details on the individual event arguments, refer to SelectionChangingEventArgs members.

This event is raised both when the user selects and deselects.

Example
This example raises the event.
private void fpSpread1_SelectionChanging(object sender, FarPoint.Win.Spread.SelectionChangingEventArgs e)
{
     FarPoint.Win.Spread.Model.CellRange cr;
     cr = e.View.Sheets[0].GetSelection(0);
     Label1.BackColor = Color.Blue;
     Label1.Text = "The first column in the selection is " + cr.Column + " and the first row is " + cr.Row;
}
Private Sub FpSpread1_SelectionChanging(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.SelectionChangingEventArgs)
Handles FpSpread1.SelectionChanging
     Dim cr As FarPoint.Win.Spread.Model.CellRange
     cr = e.View.Sheets(0).GetSelection(0)
     Label1.BackColor = Color.Blue
     Label1.Text = "The first column in the selection is " & cr.Column & " and the first row is " & cr.Row
End Sub
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

FpSpread Class
FpSpread Members
SelectionChanged Event
SelectionChangingEventArgs Class

 

 


Copyright © GrapeCity, inc. All rights reserved.