Skip to main content
Version: 2025

SalTableWindowBase

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Web.50 (5.0.0.0)

Provides the main and split grids, SAL row-context translation, and column infrastructure for table controls.

public class SalTableWindowBase : UserControl

Example:

SalTableWindow table = new SalTableWindow();
SalTableWindowBase gridHost = table;
gridHost.AllowSorting = true;
gridHost.RowHeaderWidth = 32;

Properties

Instance member ActiveColumn

SalTableColumn: Gets the SAL column associated with the current cell, or null when there is no current cell.

Instance member AllowSorting

Boolean: Gets or sets whether main-grid columns sort automatically when their headers are clicked. (Default: False)

Instance member AutoScroll

Boolean: Gets false; container automatic scrolling assignments are ignored because the grids manage scrolling. (Default: False)

Instance member AutoScrollMargin

Size: Gets an empty size; container scroll-margin assignments are ignored.

Instance member AutoScrollMinSize

Size: Gets an empty size; container minimum-scroll-size assignments are ignored.

Instance member AutoSize

Boolean: Gets false. Assignments are ignored because this table does not support automatic sizing. (Default: False)

Instance member AutoSizeMode

AutoSizeMode: Gets GrowAndShrink. Assignments are ignored.

Instance member BackgroundImage

Image: Gets null; background image assignments are ignored. (Default: null)

Instance member BackgroundImageSource

String: Gets null. Assignments are ignored because this table does not support a background image source. (Default: null)

Instance member Columns

SalTableColumnCollection: Gets the SAL column collection, creating its wrapper on first access.

Instance member ContextRow

Int32: Gets or requests a change to the SAL row context used for column-value access.

Instance member CurrentColumn

Int32: Gets the zero-based column index captured when the row context was set.

Instance member CurrentGrid

DataGridView: Gets the grid selected by the current SAL row context.

Instance member CurrentRow

Int32: Gets the stored current row index used by table navigation.

Instance member DefaultRowHeight

Int32: Gets or sets the default row height in pixels for the main grid.

Instance member DisableSplitGrid

Boolean: Gets or sets whether the split grid rejects focus and row or cell selection. (Default: False)

Instance member FocusRow

Int32: Gets the SAL row context of the current row, or selects the header cell of a valid specified row.

Instance member IsEmbedded

Boolean: Gets whether this table is hosted within another table window. The base implementation returns false.

Instance member KeyPreview

Boolean: Gets false. Assignments are ignored.

Instance member MainGrid

DataGridView: Gets the grid containing ordinary table rows.

Instance member RowHeaderFlags

Int32: Gets or replaces the row-header flags and refreshes their display.

Instance member RowHeaderImages

ArrayList: Gets the mutable collection of custom row-header images, creating it on first access.

Instance member RowHeaderTitle

String: Gets or sets the text in the main grid’s upper-left header cell.

Instance member RowHeaderWidth

Int32: Gets or sets the row-header width in pixels for both grids.

Instance member Rows

SalTableRowCollection: Gets a new live view of the main grid data rows, excluding fixed headers.

Instance member ScrollBars

ScrollBars: Gets Both. Assignments are ignored; the internal grids manage their scroll bars.

Instance member SplitGrid

DataGridView: Gets the grid containing split rows, or null when no split grid exists.

Instance member SplitGridRows

Int32: Gets the configured number of visible rows in the split grid.

Instance member SplitRows

SalTableRowCollection: Gets a new live view of secondary-grid data rows, or null when no secondary grid exists.

Instance member Splitter

SplitContainer: Gets the split container used to arrange the main and split grids.

Instance member TableFlags

Int32: Gets or replaces the SAL table flags and applies all supported table-style effects.

Methods

Instance member BeginUpdate()

Suspends updates to the main grid until EndUpdate is called.

Instance member CanEditCell(cell)

Checks whether a cell belongs to a visible, writable row and an enabled SAL column.

ParameterTypeDescription
cellDataGridViewCellThe cell to inspect, or null.

Returns: Boolean. True if the cell is non-null and its grid, row, and column permit editing.

Protected member CanEditCell(grid, row, col)

Checks grid, row, and column restrictions before allowing cell editing.

ParameterTypeDescription
gridDataGridViewThe grid containing the cell.
rowInt32The zero-based row index.
colInt32The zero-based column index.

Returns: Boolean. True if the indices are valid, the grid is writable, the row and column are visible and writable, and the associated SAL column is enabled.

Instance member CanMoveCell()

Attempts to finish editing the current grid cell before navigation.

Returns: Boolean. True if editing can finish; otherwise, false.

Protected member ClearSelectedColumns()

Clears selected columns in both grids while suppressing selection messages.

Protected member ClearSelectedRows()

Clears selected rows in both grids while suppressing selection messages.

Instance member CreateDataGridColumn(column, splitTable)

Creates a grid column matching the SAL column’s cell type and this table’s sorting mode.

ParameterTypeDescription
columnSalTableColumnThe SAL column whose cell type selects the grid column implementation.
splitTableBooleanReserved for split-grid specialization; the base implementation ignores this value.

Returns: DataGridViewColumn. A new, unattached grid column.

Throws:

Protected member CreateMainGrid()

Creates the main grid owned by this table.

Returns: DataGridViewEx. A new DataGridViewEx associated with this table.

Protected member CreateSplitGrid()

Creates the split grid owned by this table.

Returns: DataGridViewEx. A new DataGridViewEx associated with this table.

Instance member CreateSplitGrid(visibleRows, resizable)

Creates and displays the split grid, cloning the main-grid columns when first created.

ParameterTypeDescription
visibleRowsInt32The positive number of rows used to determine the initial split-grid height.
resizableBooleanTrue to let the user move the splitter; false to fix its position.

Calling this method for an existing split grid updates resizing and layout without reinitializing its height. Horizontal scrolling moves to the split grid. Throws:

Instance member DestroySplitGrid()

Disposes the split grid, detaches split columns, and restores the main grid’s scroll bars and layout.

Instance member EndUpdate()

Resumes updates to the main grid after BeginUpdate.

Instance member FinishEditing(grid, cancel)

Ends the current cell edit when the specified grid is editing.

ParameterTypeDescription
gridDataGridViewThe grid whose edit is ended.
cancelBooleanReserved for compatibility; this implementation ignores it and calls EndEdit.

Returns: Boolean. The result of EndEdit, or true when no cell is being edited.

Instance member GetCellStyle(column, row)

Gets the mutable style of a cell in the resolved main or split row.

ParameterTypeDescription
columnSalTableColumnThe SAL column identifying the cell.
rowInt32The SAL row context.

Returns: DataGridViewCellStyle. The cell style, or null if the row context, SAL column, or main-grid column is unavailable.

Instance member GetCellStyleNew(column, row)

Gets the mutable style of a cell in the resolved main or split row.

ParameterTypeDescription
columnSalTableColumnThe SAL column identifying the cell.
rowInt32The SAL row context.

Returns: DataGridViewCellStyle. The cell style, or null if the row context, SAL column, or main-grid column is unavailable.

Static member GetCellValue(cell)

Converts a cell’s value to text.

ParameterTypeDescription
cellDataGridViewCellThe cell to inspect.

Returns: String. The value’s string representation, or an empty string for a null value.

Instance member GetColHeaderStyle(column)

Gets the mutable style of the main-grid column’s header cell.

ParameterTypeDescription
columnSalTableColumnThe SAL column to inspect.

Returns: DataGridViewCellStyle. The header style, or null if the column or its main-grid column is unavailable.

Instance member GetColHeaderStyleNew(column)

Gets the mutable style of the main-grid column’s header cell.

ParameterTypeDescription
columnSalTableColumnThe SAL column to inspect.

Returns: DataGridViewCellStyle. The header style, or null if the column or its main-grid column is unavailable.

Instance member GetCols(grid)

Gets the specified grid’s column collection.

ParameterTypeDescription
gridDataGridViewThe grid to inspect.

Returns: DataGridViewColumnCollection. The grid’s live column collection.

Instance member GetColStyle(column)

Gets the mutable default cell style of the main-grid column.

ParameterTypeDescription
columnSalTableColumnThe SAL column to inspect.

Returns: DataGridViewCellStyle. The column style, or null if the column or its main-grid column is unavailable.

Instance member GetColStyleNew(column)

Gets the mutable default cell style of the main-grid column. The same style is also assigned to its split-grid column.

ParameterTypeDescription
columnSalTableColumnThe SAL column to inspect.

Returns: DataGridViewCellStyle. The column style, or null if the column or its main-grid column is unavailable.

Instance member GetContextRowFromCode(rowCode)

Expands a special SAL row code into its iteration boundary or row context.

ParameterTypeDescription
rowCodeInt32The row context or TBL_* row code.

Returns: Int32. The expanded context, or the original value for an ordinary row context.

TBL_MaxRow expands to the main row count, one past the last row. TBL_MinRow expands to the boundary preceding split rows, or -1 without a split grid. TBL_TempRow and TBL_Error map to -1; the result is not necessarily an existing row.

Instance member GetCurrentCol(grid)

Gets the column index of the specified grid’s current cell.

ParameterTypeDescription
gridDataGridViewThe grid to inspect.

Returns: Int32. The zero-based column index, or -1 when no current cell exists.

Instance member GetCurrentRow(grid)

Gets the row index of the specified grid’s current cell.

ParameterTypeDescription
gridDataGridViewThe grid to inspect.

Returns: Int32. The zero-based row index, or -1 when no current cell exists.

Instance member GetRowHeaderStyle(row)

Gets the mutable style of a row’s header cell.

ParameterTypeDescription
rowInt32The SAL row context.

Returns: DataGridViewCellStyle. The header style, or null when the row context is invalid.

Instance member GetRowHeaderStyleNew(row)

Gets the mutable style of a row’s header cell.

ParameterTypeDescription
rowInt32The SAL row context.

Returns: DataGridViewCellStyle. The header style, or null when the row context is invalid.

Instance member GetRows(grid)

Gets the specified grid’s row collection.

ParameterTypeDescription
gridDataGridViewThe grid to inspect.

Returns: DataGridViewRowCollection. The grid’s live row collection.

Instance member GetRowStyle(row)

Gets the mutable default cell style of a table row.

ParameterTypeDescription
rowInt32The SAL row context.

Returns: DataGridViewCellStyle. The row’s style, or null when the row context is invalid.

Instance member GetRowStyleNew(row)

Gets the mutable default cell style of a table row.

ParameterTypeDescription
rowInt32The SAL row context.

Returns: DataGridViewCellStyle. The row’s style, or null when the row context is invalid.

Instance member IsValidCol(cell)

Checks whether a cell identifies an existing grid column.

ParameterTypeDescription
cellDataGridViewCellThe cell to inspect, or null.

Returns: Boolean. True if the cell is non-null, the table is not disposed, and the column index is in range.

Instance member IsValidCol(grid, col)

Checks whether a column index exists in the specified grid.

ParameterTypeDescription
gridDataGridViewThe grid containing the column.
colInt32The zero-based column index.

Returns: Boolean. True if the table is not disposed and the column index is in range.

Protected member IsValidContextRow(rowNum)

Checks whether a SAL row context resolves to an existing main-grid or split-grid row.

ParameterTypeDescription
rowNumInt32The SAL row context to resolve.

Returns: Boolean. True if the context resolves to an existing row; otherwise, false.

Instance member IsValidRow(grid, row)

Checks whether a row index exists in the specified grid.

ParameterTypeDescription
gridDataGridViewThe grid containing the row.
rowInt32The zero-based row index.

Returns: Boolean. True if the table is not disposed and the row index is in range.

Instance member NotifyRender(config)

Provides a hook for adjusting table state during grid rendering.

ParameterTypeDescription
configObjectThe grid’s render configuration.

The base implementation does nothing.

Protected member OnBeginEdit(grid, e)

Provides a hook invoked when a cell is about to enter edit mode.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellCancelEventArgsThe event data.

The base implementation does nothing.

Protected member OnCausesValidationChanged(e)

Propagates the validation-trigger setting to both grids.

ParameterTypeDescription
eEventArgsThe setting-change event data.

Protected member OnCellClick(grid, e)

Provides a hook invoked when a cell is clicked.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnCellDoubleClick(grid, e)

Provides a hook invoked when a cell is double-clicked.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnCellFormatting(grid, e)

Provides a hook invoked when the grid formats a cell for display.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellFormattingEventArgsThe event data.

The base implementation does nothing.

Protected member OnCellValidated(grid, e)

Provides a hook invoked when cell validation completes.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnCellValidating(grid, e)

Provides a hook invoked when a cell’s proposed value is being validated.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellValidatingEventArgsThe event data.

The base implementation does nothing.

Protected member OnColumnHeaderMouseClick(grid, e)

Provides a hook invoked when a column header is clicked with the mouse.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellMouseEventArgsThe event data.

The base implementation does nothing.

Protected member OnColumnHeaderMouseDoubleClick(grid, e)

Provides a hook invoked when a column header is double-clicked with the mouse.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellMouseEventArgsThe event data.

The base implementation does nothing.

Protected member OnControlAdded(e)

Registers added SAL columns, redirecting them to the parent when this is an embedded table.

ParameterTypeDescription
eControlEventArgsThe event data identifying the added control.

Protected member OnControlRemoved(e)

Removes a departing SAL column from the live table before raising the base event.

ParameterTypeDescription
eControlEventArgsThe removed control.

Protected member OnCornerClick(grid, e)

Provides a hook invoked when the upper-left header cell is clicked.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnCornerDoubleClick(grid, e)

Provides a hook invoked when the upper-left header cell is double-clicked.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnCreateControl()

Attaches grid events and initializes column positions at runtime, then performs the initial layout.

Protected member OnCurrentCellChanged(grid, e)

Provides a hook invoked when the grid’s current cell changes.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eEventArgsThe event data.

The base implementation does nothing.

Protected member OnDefaultRowHeightChanged(grid, e)

Provides a hook invoked when the grid’s default row height changes.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eEventArgsThe event data.

The base implementation does nothing.

Protected member OnDoubleClick(grid, e)

Provides a hook invoked when the grid is double-clicked.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eEventArgsThe event data.

The base implementation does nothing.

Protected member OnEditingControlShowing(grid, e)

Provides a hook invoked when the grid displays a cell editor.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewEditingControlShowingEventArgsThe event data.

The base implementation does nothing.

Protected member OnEndEdit(grid, e)

Provides a hook invoked when a cell leaves edit mode.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnFontChanged(e)

Propagates the table font to cell, row-header, and column-header styles in both grids.

ParameterTypeDescription
eEventArgsThe font-change event data.

Protected member OnGotFocus(grid, e)

Provides a hook invoked when the grid receives focus.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eEventArgsThe event data.

The base implementation does nothing.

Protected member OnLastCellTab(grid, e)

Provides a hook invoked when Tab is pressed in the grid’s last cell.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnLostFocus(grid, e)

Provides a hook invoked when the grid loses focus.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eEventArgsThe event data.

The base implementation does nothing.

Protected member OnRowEnter(grid, e)

Provides a hook invoked when the current cell enters a row.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnRowHeaderMouseClick(grid, e)

Provides a hook invoked when a row header is clicked with the mouse.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellMouseEventArgsThe event data.

The base implementation does nothing.

Protected member OnRowHeaderMouseDoubleClick(grid, e)

Provides a hook invoked when a row header is double-clicked with the mouse.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellMouseEventArgsThe event data.

The base implementation does nothing.

Protected member OnRowValidated(grid, e)

Provides a hook invoked when row validation completes.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellEventArgsThe event data.

The base implementation does nothing.

Protected member OnRowValidating(grid, e)

Provides a hook invoked when a row is being validated.

ParameterTypeDescription
gridDataGridViewThe main or split grid raising the event.
eDataGridViewCellCancelEventArgsThe event data.

The base implementation does nothing.

Instance member ResetRowsHeight(grid, height)

Sets the main grid’s default row height and resets each row size in the specified grid.

ParameterTypeDescription
gridDataGridViewThe grid whose individual row sizes are reset.
heightInt32The main grid’s new default row height in pixels.

Instance member SelectFullRow(row)

Selects every cell in the specified row.

ParameterTypeDescription
rowDataGridViewRowThe row to select, or null to do nothing.

Protected member SetBoundsCore(x, y, width, height, specified)

Applies the requested bounds and rearranges the internal grids.

ParameterTypeDescription
xInt32The horizontal position in pixels.
yInt32The vertical position in pixels.
widthInt32The width in pixels.
heightInt32The height in pixels.
specifiedBoundsSpecifiedThe bounds components to update.

Protected member SetContextRow(rowNum)

Selects a valid SAL row context and records its grid, row index, and current column.

ParameterTypeDescription
rowNumInt32The SAL row number, including a split-row context when applicable.

Returns: Boolean. True if the context was resolved to an existing row; otherwise, false.

Protected member TestRowFlags(row, maskOn, maskOff)

Tests a nondeleted row against inclusion and exclusion flag masks.

ParameterTypeDescription
rowSalTableRowThe row to test.
maskOnInt32At least one of these flags must be present; zero imposes no inclusion requirement.
maskOffInt32None of these flags may be present.

Returns: Boolean. True when the row exists, is not deleted, and satisfies both masks.

Instance member TestRowHeaderFlags(flags)

Checks whether all requested row-header flags are enabled.

ParameterTypeDescription
flagsInt32The flags to test.

Returns: Boolean. True when every bit is set, including an empty mask.

Instance member TestTableFlags(flags)

Checks whether all requested table flags are enabled.

ParameterTypeDescription
flagsInt32The flags to test.

Returns: Boolean. True when every bit is set, including an empty mask.

Instance member TranslateRowContext(rowNum, rowIndex, grid)

Resolves a SAL row context into its internal grid and zero-based row index.

ParameterTypeDescription
rowNumInt32The SAL row context to resolve.
rowIndex by referenceInt32Receives the translated index; it can be out of range when the method returns false.
grid by referenceDataGridViewReceives the main or split grid selected by the context.

Returns: Boolean. True if the translated row exists; otherwise, false.

The output arguments are initialized even on failure. Temporary rows and iteration boundaries do not resolve to existing rows.

Instance member TranslateRowIndex(row)

Converts an internal grid row into its SAL row context.

ParameterTypeDescription
rowDataGridViewRowThe row to translate, or null.

Returns: Int32. The SAL row context, or TBL_Error for null or a negative row index.

Instance member TranslateRowIndex(grid, rowIndex)

Converts an internal row index into a SAL row context, adding the split-row offset when applicable.

ParameterTypeDescription
gridDataGridViewThe grid containing the row.
rowIndexInt32The zero-based internal row index.

Returns: Int32. TBL_Error for a negative index; otherwise, the ordinary or split-row context.

This method does not check the upper bound of the row index.

Instance member UpdateColumnHeaders()

Provides a hook for synchronizing SAL column headers.

The base implementation does nothing.

Instance member UpdateColumnWidths()

Provides a hook for synchronizing SAL column widths.

The base implementation does nothing.

Instance member UpdateRowHeaders()

Refreshes row headers in the main grid and, when present, the split grid.

Inherited By

NameDescription
SalTableWindowDisplays SAL table rows and columns in a web grid, with row contexts, split rows, validation messages, and SQL population.