Class GridCurrentCellManager
Represents a class that manages the current cell operation in SfDataGrid.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public class GridCurrentCellManager : Object, IDisposable
Constructors
GridCurrentCellManager(SfDataGrid)
Initializes a new instance of GridCurrentCellManager class.
Declaration
public GridCurrentCellManager(SfDataGrid grid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | grid | An instance of SfDataGrid class. |
Fields
dataGrid
Gets or sets an instance of SfDataGrid class.
Declaration
protected SfDataGrid dataGrid
Field Value
Type |
---|
SfDataGrid |
ResumeUpdates
Gets or sets the action that encapsulates the ResumeUpdates() method.
Declaration
protected Action ResumeUpdates
Field Value
Type |
---|
System.Action |
SuspendUpdates
Gets or sets the action that encapsulates the SuspendUpdates() method.
Declaration
protected Action SuspendUpdates
Field Value
Type |
---|
System.Action |
Properties
CurrentCell
Gets or sets the Current cell.
Declaration
public DataColumnBase CurrentCell { get; set; }
Property Value
Type |
---|
DataColumnBase |
CurrentRowColumnIndex
Gets the current RowColumnIndex of the row or cell that contains the current cell.
Declaration
public RowColumnIndex CurrentRowColumnIndex { get; }
Property Value
Type |
---|
RowColumnIndex |
CurrentUnboundRowInfo
Gets or sets the GridUnBoundRow of corresponding unbound row that contains current cell.
Declaration
protected GridUnBoundRow CurrentUnboundRowInfo { get; set; }
Property Value
Type | Description |
---|---|
GridUnBoundRow | The GridUnBoundRow of unbound row that contains current cell. Returns null if there is no current cell in unbound row. |
HasCurrentCell
Returns a value that indicates whether the SfDataGrid that contains the currently active cell.
Declaration
public bool HasCurrentCell { get; }
Property Value
Type |
---|
System.Boolean |
IsAddNewRow
Gets or sets a value that indicates whether the current cell is placed on the AddNewRow.
Declaration
protected bool IsAddNewRow { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the current cell is placed on the AddNewRow; otherwise, false. |
IsFilterRow
Gets or sets a value that indicates whether the current cell is placed on the FilterRow.
Declaration
protected bool IsFilterRow { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the current cell is placed on the FilterRow; otherwise, false. |
IsUnBoundRow
Declaration
protected bool IsUnBoundRow { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
AllowCurrentCellSelection(RowColumnIndex)
Determines whether the selection is allowed for the specified rowcolumnindex of current cell.
Declaration
protected bool AllowCurrentCellSelection(RowColumnIndex currentCellIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | currentCellIndex | The corresponding rowcolumnindex. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the selection is allowed to the current cell; otherwise , false. |
AllowFocus(RowColumnIndex)
Determines whether the focus is allowed for the specified rowcolumnindex .
Declaration
protected bool AllowFocus(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the focus is allowed for the specified rowcolumnindex; otherwise, false. |
BeginEdit()
Initiates the edit operation on the current cell.
Declaration
public bool BeginEdit()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the current cell entering into edit mode; otherwise, false . |
CanSelectRowOrCell(RowColumnIndex)
Determines whether the selection can be processed for row or cell corresponding to the specified row and column index.
Declaration
protected bool CanSelectRowOrCell(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding row and column index to perform row or cell selection. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the row or cell selection can be processed; otherwise, false. |
CheckValidationAndEndEdit()
Determines whether the validation is applied to the current cell.
Declaration
public bool CheckValidationAndEndEdit()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the current cell validation is successful and the cell is allowed for end edit operation; otherwise, false. |
Dispose()
Disposes all the resources used by the VisualContainer class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the VisualContainer class.
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
EndEdit(Boolean)
Ends the edit operation on the current cell.
Declaration
public bool EndEdit(bool canCommit = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canCommit | Specifies whether the value can be committed to the current cell. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the edit operation is ended; otherwise, false. |
GetFirstCellIndex(FlowDirection)
Gets the index of first cell in SfDataGrid for the specified flow direction.
Declaration
protected int GetFirstCellIndex(FlowDirection direction)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.FlowDirection | direction | Contains the direction to get first cell index in SfDataGrid. |
Returns
Type | Description |
---|---|
System.Int32 | The first cell index in SfDataGrid for the specified flow direction. |
GetGridColumn(RowColumnIndex)
Gets the column for the specified RowColumnIndex.
Declaration
protected GridColumn GetGridColumn(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding row and column index to get the column. |
Returns
Type | Description |
---|---|
GridColumn | Returns the corresponding GridColumn for the specified row and column index; otherwise , return null. |
GetLastCellIndex(FlowDirection)
Gets the index of the last focused cell corresponding to the specified direction.
Declaration
protected int GetLastCellIndex(FlowDirection direction)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.FlowDirection | direction | The corresponding direction of the cell to get its index. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the corresponding index of last focused cell. |
GetMergedColumn(GridColumn, Int32, MoveDirection)
Gets the merged column for the specified range.
Declaration
protected GridColumn GetMergedColumn(GridColumn gridcolumn, int columnIndex, MoveDirection direction)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | gridcolumn | The corresponding grid column to get merged column. |
System.Int32 | columnIndex | The corresponding column index to get merged column |
MoveDirection | direction | Contains the corresponding direction to get merged column. |
Returns
Type | Description |
---|---|
GridColumn | Returns the corresponding merged column based on the specified range. |
GetNextCellIndex(Int32, Int32)
Gets the index of next focused cell corresponding to the specified row and column index.
Declaration
protected int GetNextCellIndex(int rowIndex, int columnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding row index to get the next cell index. |
System.Int32 | columnIndex | The corresponding column index to get the next cell index. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of next focused cell. |
GetNextCellIndex(FlowDirection)
Gets the index of the next focused cell corresponding to the specified direction.
Declaration
protected int GetNextCellIndex(FlowDirection flowdirection)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.FlowDirection | flowdirection | The corresponding direction to get the index of next focused cell. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of next focused cell. |
GetNextFocusGridColumn(Int32, MoveDirection)
Gets the next focused grid column for the specified column index and direction.
Declaration
protected GridColumn GetNextFocusGridColumn(int columnIndex, MoveDirection direction)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | columnIndex | The corresponding column index to get the next focused column. |
MoveDirection | direction | Specifies flow direction to get the next focused column. |
Returns
Type | Description |
---|---|
GridColumn | The next focused GridColumn for specified column index and direction. Returns null, if the specified column index is last column. |
GetNextPageIndex(Int32, Int32, Boolean)
Gets the index of the row positioned at the end of next page that is not currently in view of SfDataGrid.
Declaration
protected int GetNextPageIndex(int rowIndex, int columnIndex, bool scrolling = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding row index to get next page index. |
System.Int32 | columnIndex | The corresponding column index to get next page index. |
System.Boolean | scrolling | Indicates whether the entire cell need to be scrolled in view , when the specified row index is merged cell. |
Returns
Type | Description |
---|---|
System.Int32 | The end row index of next page. |
GetNextRowIndex(Int32)
Gets the index of the next row corresponding to the specified row index.
Declaration
protected int GetNextRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding index to get the index of next row. |
Returns
Type | Description |
---|---|
System.Int32 | The index of next row; Returns , -1 when the row index is last row index. |
GetNextRowIndex(Int32, Int32, Boolean)
Gets the next focused row index corresponding to the specified row and column index.
Declaration
protected int GetNextRowIndex(int rowIndex, int columnIndex, bool scrolling = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding row index to get next focused row index. |
System.Int32 | columnIndex | The corresponding column index to get next focused row index. |
System.Boolean | scrolling | Indicates whether the entire cell need to be scrolled in view , when the specified row index is merged cell. |
Returns
Type | Description |
---|---|
System.Int32 | The next focused row index of the specified row and column index. |
GetPreviousCellIndex(FlowDirection)
Gets the index of previous cell corresponding to the specified flow direction.
Declaration
protected int GetPreviousCellIndex(FlowDirection flowdirection)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.FlowDirection | flowdirection | The corresponding direction to get previous cell index. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of previous cell. |
GetPreviousPageIndex(Int32, Int32)
Gets the index of the row positioned at the start of the previous page that is not currently in view of SfDataGrid.
Declaration
protected int GetPreviousPageIndex(int rowIndex, int columnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding row index to get previous page index. |
System.Int32 | columnIndex | The corresponding column index to get previous page index. |
Returns
Type | Description |
---|---|
System.Int32 | The start index of previous page. |
GetPreviousRowIndex(Int32)
Gets the index of previous row corresponding to the specified row index.
Declaration
protected int GetPreviousRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding index to get the previous row index. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of previous row. |
GetPreviousRowIndex(Int32, Int32)
Gets the index of previous row corresponding to the specified row and column index.
Declaration
protected int GetPreviousRowIndex(int rowIndex, int columnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding row index to get the index of previous row. |
System.Int32 | columnIndex | The corresponding column index to get the index of previous row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of previous row. |
HandleColumnsCollectionChanged(NotifyCollectionChangedEventArgs)
Handles the current cell selection when the columns is added or removed at run time.
Declaration
public virtual void HandleColumnsCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | args | Contains the data related to the collection changed action in columns collection. |
HandleKeyDown(KeyEventArgs)
Handles the selection for the keyboard interactions that are performed current cell.
Declaration
public virtual bool HandleKeyDown(KeyEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | args | Contains information about the key that was pressed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key should be handled; otherwise, false. |
HandleKeyNavigation(KeyEventArgs, RowColumnIndex)
Handles the selection when the key navigation is processed on the current cell.
Declaration
public virtual bool HandleKeyNavigation(KeyEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | args | Contains information about the key that was pressed. |
RowColumnIndex | rowColumnIndex | The corresponding row and column index where the key navigation occurs. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the navigation processed; otherwise , false. |
Remarks
Override this method , to customize navigation behavior of current cell in SfDataGrid.
HandlePointerOperation(MouseEventArgs, RowColumnIndex)
Handles the current cell selection when any of PointerOperation performed in cell.
Declaration
public virtual bool HandlePointerOperation(MouseEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | args | Contains the data related to the mouse action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex of the cell. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the pointer operation should be handled on the current cell; otherwise, false. |
ProcessColumnRemoveAndInsert(GridColumn, Int32, NotifyCollectionChangedAction)
Processes the current cell when column added or removed at runtime.
Declaration
protected void ProcessColumnRemoveAndInsert(GridColumn changedColumn, int changedIndex, NotifyCollectionChangedAction action)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | changedColumn | Contains the corresponding changed column. |
System.Int32 | changedIndex | The corresponding index of the column. |
System.Collections.Specialized.NotifyCollectionChangedAction | action | Corresponding collection changed action performed on columns. |
ProcessCurrentCellSelection(RowColumnIndex, ActivationTrigger)
Processes the selection for current cell corresponding to its rowcolumnindex and activation trigger.
Declaration
protected virtual bool ProcessCurrentCellSelection(RowColumnIndex newRowColumnIndex, ActivationTrigger activationTriggger)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | newRowColumnIndex | The corresponding rowcolumnindex to process the current cell selection. |
ActivationTrigger | activationTriggger | Indicates how the current cell is activated. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the selection is processed on the current cell; otherwise, false. |
ProcessOnDoubleTapped(MouseButtonEventArgs)
Processes the selection when the mouse point is double tapped on the current cell.
Declaration
public virtual void ProcessOnDoubleTapped(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | Contains the data related to the double tap interaction. |
Remarks
This method invoked to process selection and end edit the cell when EditTrigger is OnDoubleTap.
ProcessOnTapped(MouseButtonEventArgs, RowColumnIndex)
Processes the selection when the mouse point is tapped on the current cell.
Declaration
public virtual void ProcessOnTapped(MouseButtonEventArgs e, RowColumnIndex currentRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | Contains the data related to the tap interaction. |
RowColumnIndex | currentRowColumnIndex | The corresponding rowColumnIndex of the mouse point. |
Remarks
This method invoked to process selection and end edit the current cell when EditTrigger is OnTap.
RaiseCurrentCellActivatedEvent(RowColumnIndex, RowColumnIndex, ActivationTrigger)
Raises the CurrentCellActivated event in SfDataGrid.
Declaration
protected void RaiseCurrentCellActivatedEvent(RowColumnIndex rowColumnIndex, RowColumnIndex previousRowColumnIndex, ActivationTrigger activationTrigger)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | |
RowColumnIndex | previousRowColumnIndex | The rowcolumnindex of the precious active cell. |
ActivationTrigger | activationTrigger | The activation trigger for current cell. |
RaiseCurrentCellActivatingEvent(RowColumnIndex, RowColumnIndex, ActivationTrigger)
Raises the CurrentCellActivating event in SfDataGrid.
Declaration
protected bool RaiseCurrentCellActivatingEvent(RowColumnIndex previousRowColumnIndex, RowColumnIndex currentRowColumnIndex, ActivationTrigger activationTrigger)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | previousRowColumnIndex | The rowcolumnindex of the precious active cell. |
RowColumnIndex | currentRowColumnIndex | The rowcolumnindex of the currently active cell. |
ActivationTrigger | activationTrigger | The activation trigger for current cell. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the CurrentCellActivating event is raised; otherwise, false. |
RaiseCurrentCellBeginEditEvent(RowColumnIndex, GridColumn)
Raises the CurrentCellBeginEdit event.
Declaration
protected bool RaiseCurrentCellBeginEditEvent(RowColumnIndex rowColumnIndex, GridColumn gridColumn)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding rowcolumnindex of the current cell. |
GridColumn | gridColumn | The corresponding column that contains the current cell. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the CurrentCellBeginEdit event is raised; otherwise, false. |
RaiseCurrentCellEndEditEvent(RowColumnIndex)
Raises the CurrentCellEndEdit event.
Declaration
protected void RaiseCurrentCellEndEditEvent(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The rowcolumnindex of the current cell to raise the event. |
RaiseValidationAndEndEdit(Boolean)
Declaration
protected bool RaiseValidationAndEndEdit(bool canCommit = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canCommit |
Returns
Type |
---|
System.Boolean |
RemoveCurrentCell(RowColumnIndex)
Removes the current cell based on the specified row and column index.
Declaration
protected void RemoveCurrentCell(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding rowcolumnindex to remove the current cell. |
Remarks
This method helps to remove the current cell corresponding to the specified row and column index.
ScrollInView(RowColumnIndex)
Scrolls the SfDataGrid vertically and horizontally to display a cell for the specified RowColumnIndex.
Declaration
protected void ScrollInView(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Specifies the rowColumnIndex of the cell to bring into view. |
ScrollInViewFromLeft(Int32)
Scrolls the specified column index in to view from the left direction to the SfDataGrid.
Declaration
public void ScrollInViewFromLeft(int columnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | columnIndex | The corresponding column index to scroll the column into view. |
Remarks
This method helps to scroll the column into view when the column is not present in the view area of SfDataGrid.
ScrollInViewFromRight(Int32)
Scrolls the specified column index in to view from the right direction to the SfDataGrid.
Declaration
public void ScrollInViewFromRight(int columnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | columnIndex | The corresponding column index to scroll the column into view. |
Remarks
This method helps to scroll the column into view if it is not present in the view area of SfDataGrid.
ScrollToRowIndex(Int32)
Scrolls the row in to view at the specified row index.
Declaration
protected void ScrollToRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The zero-based row index to scroll the row into view. |
SelectCurrentCell(RowColumnIndex, Boolean)
Selects the current cell for the specified row and column index.
Declaration
protected void SelectCurrentCell(RowColumnIndex rowColumnIndex, bool setFocus = true)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding rowcolumnindex to select the current cell. |
System.Boolean | setFocus | Decides whether the focus is set to current cell. |
SetCurrentRowColumnIndex(RowColumnIndex)
Sets the current rowcolumnindex.
Declaration
protected void SetCurrentRowColumnIndex(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The rowcolumnindex. |
UpdateGridProperties(RowColumnIndex)
Updates the Grid properties.
Declaration
protected void UpdateGridProperties(RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex |