C# Класс SourceGrid.Selection.SelectionBase

Base selection class
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BindToGrid ( GridVirtual p_grid ) : void

Link the cell at the specified grid. For internal use only.

CanReceiveFocus ( Position position ) : bool

Returns true if the specified position can receive the focus.

Focus ( Position pCellToActivate, bool pResetSelection ) : bool

Change the ActivePosition (focus) of the grid.

FocusColumn ( int column ) : bool

Move the Focus to the first cell that can receive the focus of the current column otherwise put the focus to null.

FocusFirstCell ( bool pResetSelection ) : bool

Set the focus on the first available cells starting from the not fixed cells. If there is an active selection set the focus on the first selected cells.

FocusRow ( int row ) : bool

Move the Focus to the first cell that can receive the focus of the current row otherwise put the focus to null.

GetSelectionRegion ( ) : RangeRegion

Returns the selected region.

IntersectsWith ( Range rng ) : bool

Returns true if the specified selection intersect with the range

Invalidate ( ) : void

Invalidate all the selected cells

IsEmpty ( ) : bool

Returns true if the selection is empty

IsSelectedCell ( Position position ) : bool

Check if the cell is selected.

IsSelectedColumn ( int column ) : bool

Check if the column is selected. Returns true if one or more row of the column is selected.

IsSelectedRange ( Range range ) : bool

Check if the range is selected.

IsSelectedRow ( int row ) : bool

Check if the row is selected. Returns true if one or more column of the row is selected.

MoveActiveCell ( Position start, int rowShift, int colShift ) : bool

Move the active cell (focus), moving the row and column as specified. Returns true if the focus can be moved. Returns false if there aren't any cell to move.

MoveActiveCell ( Position start, int rowShift1, int colShift1, int rowShift2, int colShift2 ) : bool

Move the active cell (focus), moving the row and column as specified. Try to set the focus using the first shift, if failed try to use the second shift (rowShift2, colShift2). If rowShift2 or colShift2 is int.MaxValue the next start position is the maximum row or column, if is int.MinValue 0 is used, otherwise the current position is shifted using the specified value. This method is usually used for the Tab navigation using this code : MoveActiveCell(0,1,1,0); Returns true if the focus can be moved. Returns false if there aren't any cell to move.

MoveActiveCell ( int rowShift, int colShift ) : bool

Move the active cell (focus), moving the row and column as specified. Returns true if the focus can be moved. Returns false if there aren't any cell to move.

MoveActiveCell ( int rowShift1, int colShift1, int rowShift2, int colShift2 ) : bool

Move the active cell (focus), moving the row and column as specified. Try to set the focus using the first shift, if failed try to use the second shift (rowShift2, colShift2). If rowShift2 or colShift2 is int.MaxValue the next start position is the maximum row or column, if is int.MinValue 0 is used, otherwise the current position is shifted using the specified value. This method is usually used for the Tab navigation using this code : MoveActiveCell(0,1,1,0); Returns true if the focus can be moved. Returns false if there aren't any cell to move.

ResetSelection ( bool mantainFocus ) : void

Reset the selection

SelectCell ( Position position, bool select ) : void

Select or unselect the specified cell

SelectColumn ( int column, bool select ) : void

Select or unselect the specified column

SelectRange ( Range range, bool select ) : void

Select or unselect the specified range

SelectRow ( int row, bool select ) : void

Select or unselect the specified row

SelectionBase ( ) : System

Constructor

UnBindToGrid ( ) : void

Remove the link of the cell from the grid. For internal use only.

Защищенные методы

Метод Описание
OnCellGotFocus ( ChangeActivePositionEventArgs e ) : void

Fired when a cell receive the focus

OnCellLostFocus ( ChangeActivePositionEventArgs e ) : void

Fired when a cell lost the focus

OnFocusColumnEntered ( ColumnEventArgs e ) : void

Fired after a column receive the focus

OnFocusColumnLeaving ( ColumnCancelEventArgs e ) : void

Fired before a column lost the focus

OnFocusRowEntered ( RowEventArgs e ) : void

Fired after a row receive the focus

OnFocusRowLeaving ( RowCancelEventArgs e ) : void

Fired before a row lost the focus

OnResetSelection ( ) : void

Reset the selection

OnSelectionChanged ( EventArgs e ) : void
ValidateRange ( Range rng ) : Range

Check if the range can be selected

Приватные методы

Метод Описание
IsActivePositionValid ( ) : bool
SearchForValidFocusPosition ( ) : Position
SearchForValidFocusPosition ( PositionCollection positions ) : Position

Описание методов

BindToGrid() публичный Метод

Link the cell at the specified grid. For internal use only.
public BindToGrid ( GridVirtual p_grid ) : void
p_grid GridVirtual
Результат void

CanReceiveFocus() публичный Метод

Returns true if the specified position can receive the focus.
public CanReceiveFocus ( Position position ) : bool
position Position
Результат bool

Focus() публичный Метод

Change the ActivePosition (focus) of the grid.
public Focus ( Position pCellToActivate, bool pResetSelection ) : bool
pCellToActivate Position
pResetSelection bool True to deselect the previous selected cells
Результат bool

FocusColumn() публичный Метод

Move the Focus to the first cell that can receive the focus of the current column otherwise put the focus to null.
public FocusColumn ( int column ) : bool
column int
Результат bool

FocusFirstCell() публичный Метод

Set the focus on the first available cells starting from the not fixed cells. If there is an active selection set the focus on the first selected cells.
public FocusFirstCell ( bool pResetSelection ) : bool
pResetSelection bool
Результат bool

FocusRow() публичный Метод

Move the Focus to the first cell that can receive the focus of the current row otherwise put the focus to null.
public FocusRow ( int row ) : bool
row int
Результат bool

GetSelectionRegion() публичный абстрактный Метод

Returns the selected region.
public abstract GetSelectionRegion ( ) : RangeRegion
Результат RangeRegion

IntersectsWith() публичный абстрактный Метод

Returns true if the specified selection intersect with the range
public abstract IntersectsWith ( Range rng ) : bool
rng Range
Результат bool

Invalidate() публичный Метод

Invalidate all the selected cells
public Invalidate ( ) : void
Результат void

IsEmpty() публичный абстрактный Метод

Returns true if the selection is empty
public abstract IsEmpty ( ) : bool
Результат bool

IsSelectedCell() публичный абстрактный Метод

Check if the cell is selected.
public abstract IsSelectedCell ( Position position ) : bool
position Position
Результат bool

IsSelectedColumn() публичный абстрактный Метод

Check if the column is selected. Returns true if one or more row of the column is selected.
public abstract IsSelectedColumn ( int column ) : bool
column int
Результат bool

IsSelectedRange() публичный абстрактный Метод

Check if the range is selected.
public abstract IsSelectedRange ( Range range ) : bool
range Range
Результат bool

IsSelectedRow() публичный абстрактный Метод

Check if the row is selected. Returns true if one or more column of the row is selected.
public abstract IsSelectedRow ( int row ) : bool
row int
Результат bool

MoveActiveCell() публичный Метод

Move the active cell (focus), moving the row and column as specified. Returns true if the focus can be moved. Returns false if there aren't any cell to move.
public MoveActiveCell ( Position start, int rowShift, int colShift ) : bool
start Position
rowShift int
colShift int
Результат bool

MoveActiveCell() публичный Метод

Move the active cell (focus), moving the row and column as specified. Try to set the focus using the first shift, if failed try to use the second shift (rowShift2, colShift2). If rowShift2 or colShift2 is int.MaxValue the next start position is the maximum row or column, if is int.MinValue 0 is used, otherwise the current position is shifted using the specified value. This method is usually used for the Tab navigation using this code : MoveActiveCell(0,1,1,0); Returns true if the focus can be moved. Returns false if there aren't any cell to move.
public MoveActiveCell ( Position start, int rowShift1, int colShift1, int rowShift2, int colShift2 ) : bool
start Position
rowShift1 int
colShift1 int
rowShift2 int
colShift2 int
Результат bool

MoveActiveCell() публичный Метод

Move the active cell (focus), moving the row and column as specified. Returns true if the focus can be moved. Returns false if there aren't any cell to move.
public MoveActiveCell ( int rowShift, int colShift ) : bool
rowShift int
colShift int
Результат bool

MoveActiveCell() публичный Метод

Move the active cell (focus), moving the row and column as specified. Try to set the focus using the first shift, if failed try to use the second shift (rowShift2, colShift2). If rowShift2 or colShift2 is int.MaxValue the next start position is the maximum row or column, if is int.MinValue 0 is used, otherwise the current position is shifted using the specified value. This method is usually used for the Tab navigation using this code : MoveActiveCell(0,1,1,0); Returns true if the focus can be moved. Returns false if there aren't any cell to move.
public MoveActiveCell ( int rowShift1, int colShift1, int rowShift2, int colShift2 ) : bool
rowShift1 int
colShift1 int
rowShift2 int
colShift2 int
Результат bool

OnCellGotFocus() защищенный Метод

Fired when a cell receive the focus
protected OnCellGotFocus ( ChangeActivePositionEventArgs e ) : void
e ChangeActivePositionEventArgs
Результат void

OnCellLostFocus() защищенный Метод

Fired when a cell lost the focus
protected OnCellLostFocus ( ChangeActivePositionEventArgs e ) : void
e ChangeActivePositionEventArgs
Результат void

OnFocusColumnEntered() защищенный Метод

Fired after a column receive the focus
protected OnFocusColumnEntered ( ColumnEventArgs e ) : void
e ColumnEventArgs
Результат void

OnFocusColumnLeaving() защищенный Метод

Fired before a column lost the focus
protected OnFocusColumnLeaving ( ColumnCancelEventArgs e ) : void
e ColumnCancelEventArgs
Результат void

OnFocusRowEntered() защищенный Метод

Fired after a row receive the focus
protected OnFocusRowEntered ( RowEventArgs e ) : void
e RowEventArgs
Результат void

OnFocusRowLeaving() защищенный Метод

Fired before a row lost the focus
protected OnFocusRowLeaving ( RowCancelEventArgs e ) : void
e RowCancelEventArgs
Результат void

OnResetSelection() защищенный абстрактный Метод

Reset the selection
protected abstract OnResetSelection ( ) : void
Результат void

OnSelectionChanged() защищенный Метод

protected OnSelectionChanged ( EventArgs e ) : void
e System.EventArgs
Результат void

ResetSelection() публичный Метод

Reset the selection
public ResetSelection ( bool mantainFocus ) : void
mantainFocus bool
Результат void

SelectCell() публичный абстрактный Метод

Select or unselect the specified cell
public abstract SelectCell ( Position position, bool select ) : void
position Position
select bool
Результат void

SelectColumn() публичный абстрактный Метод

Select or unselect the specified column
public abstract SelectColumn ( int column, bool select ) : void
column int
select bool
Результат void

SelectRange() публичный абстрактный Метод

Select or unselect the specified range
public abstract SelectRange ( Range range, bool select ) : void
range Range
select bool
Результат void

SelectRow() публичный абстрактный Метод

Select or unselect the specified row
public abstract SelectRow ( int row, bool select ) : void
row int
select bool
Результат void

SelectionBase() публичный Метод

Constructor
public SelectionBase ( ) : System
Результат System

UnBindToGrid() публичный Метод

Remove the link of the cell from the grid. For internal use only.
public UnBindToGrid ( ) : void
Результат void

ValidateRange() защищенный Метод

Check if the range can be selected
protected ValidateRange ( Range rng ) : Range
rng Range
Результат Range