Class FormulaRangeSelectionController
Controller to select the cell or range references directly while editing the formula.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Spreadsheet
Assembly: Syncfusion.Spreadsheet.Windows.dll
Syntax
public class FormulaRangeSelectionController : IDisposable
Remarks
Handles the keyboard and mouse interaction to select the formula range references. And also it visually denotes the range references if the cell has formula while editing.
Constructors
FormulaRangeSelectionController()
Initializes a new instance of the FormulaRangeSelectionController class.
Declaration
public FormulaRangeSelectionController()
Properties
AllowMouseSelection
Gets or sets a value indicating whether the user is allowed to perform the formula range selection with mouse or keyboard.
Declaration
public bool AllowMouseSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the user can perform the formula range selection with mouse or keyboard; otherwise, false |
AllowSelectionOnEditing
Gets or sets a value indicating whether it visually denotes the range references if the cell has formula while editing .
Declaration
public bool AllowSelectionOnEditing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the cell has formula for selection while editing ; otherwise, false. |
Methods
CanSelectFormulaRange(String)
Determines whether the formula range selection happens or not.
Declaration
protected virtual bool CanSelectFormulaRange(string renderedText)
Parameters
Type | Name | Description |
---|---|---|
System.String | renderedText | Text in the current range. |
Returns
Type | Description |
---|---|
System.Boolean | True if the formula range is selection was successful;otherwise, False. |
Remarks
Used to determine whether the selection can be done in the given range which starts with equal sign.
Dispose()
Declaration
public virtual void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
End()
Below method is used to End the RangeSelection
Declaration
public string End()
Returns
Type | Description |
---|---|
System.String | String value ie. Range Selection Value |
Remarks
The CurrentCellRendererElement value is copied temporarirly before clearing the values and it is returned
HandleKeyDown(KeyEventArgs)
Handles the key down operations in SfSpreadsheet.
Declaration
protected virtual bool HandleKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e | An System.Windows.Input.KeyEventArgs that contains the event data. |
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
Remarks
Invoked when the key is pressed while the
HandlePointerOperations(GridPointerEventArgs, RowColumnIndex)
Handles the mouse pointer operations in SfSpreadsheet
Declaration
protected virtual bool HandlePointerOperations(GridPointerEventArgs args, RowColumnIndex rowcolIndex)
Parameters
Type | Name | Description |
---|---|---|
GridPointerEventArgs | args | An GridPointerEventArgs that contains the event data. |
RowColumnIndex | rowcolIndex | The row and column index where the pointer is positioned |
Returns
Type | Description |
---|---|
System.Boolean | True or False |
Remarks
Based on the one of the enumeration PointerOperation values, corresponding pointer operation is performed in SfSpreadsheet
OnPointerMoved(MouseEventArgs, RowColumnIndex)
Invoked when the mouse pointer is moved while the
Declaration
protected virtual bool OnPointerMoved(MouseEventArgs e, RowColumnIndex rowColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | An System.Windows.Input.MouseEventArgs that contains the event data. |
RowColumnIndex | rowColIndex | The row and column index where the mouse pointer is positioned. |
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
Remarks
The mouse interactions are received, processed, and managed as pointer input in SfSpreadsheet. Hence whenever the mouse moves over an element's bounds, even if no mouse button is pressed at the time also invokes this function which determines the action to be performed in SpreadsheetGrid with the formula range.
OnPointerPressed(MouseEventArgs, RowColumnIndex)
Invoked when the mouse pointer is pressed while the
Declaration
protected virtual bool OnPointerPressed(MouseEventArgs e, RowColumnIndex rowColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | An System.Windows.Input.MouseEventArgs that contains the event data. |
RowColumnIndex | rowColIndex | The row and column index where the mouse pointer is pressed. |
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
Remarks
The mouse interactions are received, processed, and managed as pointer input in SfSpreadsheet.Clicking on any of the mouse buttons(left,wheel,right) invokes this function which determines the action to be performed in SpreadsheetGrid with the formula range.
OnPointerReleased(MouseEventArgs, RowColumnIndex)
Invoked when the mouse pointer is released while the
Declaration
protected virtual bool OnPointerReleased(MouseEventArgs e, RowColumnIndex rowColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | An System.Windows.Input.MouseEventArgs that contains the event data. |
RowColumnIndex | rowColIndex | The row and column index where the mouse pointer is positioned. |
Returns
Type | Description |
---|---|
System.Boolean | True or False |
Remarks
The mouse interactions are received, processed, and managed as pointer input in SfSpreadsheet. Invoked only when that same mouse button is released (no other button can be associated with the pointer until this event is complete).
ProcessHeaderSelection(RowColumnIndex)
Updates the formula range for the selection in header cells based on the given row and column index of
Declaration
protected virtual void ProcessHeaderSelection(RowColumnIndex rowColIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColIndex | The Row and Column index where the pointer is positioned. |
Remarks
Invoked by OnPointerMoved, OnPointerPressed and ProcessKeyNavigation methods to update the selection.
ProcessKeyNavigation(KeyEventArgs)
Process and selects the formula ranges when any arrow key is pressed.
Declaration
protected virtual void ProcessKeyNavigation(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e | An System.Windows.Input.KeyEventArgs that contains the event data. |
Remarks
To customize the Keyboard interactions in
ProcessShiftKeyNavigation(KeyEventArgs)
Process and selects the formula ranges when any arrow key is pressed along with Shift key.
Declaration
protected virtual void ProcessShiftKeyNavigation(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e | An System.Windows.Input.KeyEventArgs that contains the event data. |
Remarks
Invoked by ProcessKeyNavigation method and maintains the last selected row and column index of the formula range.
Start()
Below Method starts the range seection.
Declaration
public void Start()