Interface

DBKit.SDK.RowsListControl

DBKit.SDK.RowsListControl


Description

Implemented by a control that displays many rows at once, such as DBKit.Table. It is the largest of the SDK interfaces, because the control takes over everything a list of rows involves: DBKit hands it the rows to display, asks it which row is selected and which rows have changed, and tells it to add, reload and remove rows as the layout's data changes.

It extends DBKit.SDK.RowBase, so a control implementing it also provides the RowBase methods and receives row events through DBKit.SDK.RowEventReceiver.

Writing a control of this kind is the advanced case; most developers never need to. DBKit.Table is the implementation the built-in layouts work with.

Methods

Name

Parameters

Returns

AddRowsToList

rows As RowSet, primaryKeyColumnName As String

AddRowToList

row As DBKit.Row = Nil

ChangedRows

Dictionary

ChangedRowsUpdated

Boolean

ClearChangedRows

CurrentRow

DBKit.Row

FormatRow

index As Integer

GetColumnNames

String

GetForeignKeyColumnName

String

GetLastAddedRowIndex

Integer

GetLastRowIndex

Integer

GetOrderBy

String

GetRowCount

Integer

GetSelectedRowIndex

Integer

IsValidColumnName

columnName As String, tableName As String = ""

Boolean

LoadRelatedRows

currentRow As DBKit.Row

ManageRowChangedEvent

index As Integer, columnIndex As Integer = -1, rowEditMode As Boolean = False

MoveFocusToCellAt

row As Integer, column As Integer

NewRow

PrimaryKeyAt

index As Integer

String

PrimaryKeyAt

index As Integer, Assigns value As String

PrimaryKeyColumnNameForTable

tableName As String

String

PrimaryKeyRowIndex

primaryKey As String

Integer

ReloadRow

index As Integer

RemoveAllRows

RemoveLayoutAt

index As Integer

RemoveRowAt

index As Integer, immediately As Boolean = False

SetAllowSelectionChangedEvent

allow As Boolean = True

SetSelectedRowIndex

index As Integer

UpdateRow

row As DBKit.Row, index As Integer

Method descriptions


DBKit.SDK.RowsListControl.AddRowsToList

AddRowsToList(rows As RowSet, primaryKeyColumnName As String)

Called by DBKit to give the control a set of rows to display, as produced by a query. primaryKeyColumnName is the name of the primary key column in the RowSet.


DBKit.SDK.RowsListControl.AddRowToList

AddRowToList(row As DBKit.Row = Nil)

Called by DBKit to add a single row to the rows the control displays.


DBKit.SDK.RowsListControl.ChangedRows

ChangedRows() As Dictionary

Returns the rows that have been edited in the control and not yet saved.


DBKit.SDK.RowsListControl.ChangedRowsUpdated

ChangedRowsUpdated() As Boolean

Called by DBKit when the layout is saved, to write the control's changed rows to the database. Returns True if the changes were written successfully.


DBKit.SDK.RowsListControl.ClearChangedRows

ClearChangedRows()

Called by DBKit to discard the control's record of edited rows, for example after they have been saved or undone.


DBKit.SDK.RowsListControl.CurrentRow

CurrentRow() As DBKit.Row

Returns the control's currently selected row, or Nil if no row is selected.


DBKit.SDK.RowsListControl.FormatRow

FormatRow(index As Integer)

Called by DBKit to have the control apply its formatting to the row at index.


DBKit.SDK.RowsListControl.GetColumnNames

GetColumnNames() As String

Returns the names of the columns the control displays, separated by commas. DBKit uses them to build the query that loads the control's rows.


DBKit.SDK.RowsListControl.GetForeignKeyColumnName

GetForeignKeyColumnName() As String

Returns the name of the foreign key column that relates the control's table to its layout's table, when the control displays related rows.


DBKit.SDK.RowsListControl.GetLastAddedRowIndex

GetLastAddedRowIndex() As Integer

Returns the index of the row most recently added to the control, or -1 if no row has been added.


DBKit.SDK.RowsListControl.GetLastRowIndex

GetLastRowIndex() As Integer

Returns the index of the control's last row.


DBKit.SDK.RowsListControl.GetOrderBy

GetOrderBy() As String

Returns the ordering the control's rows are sorted by, as used in the query that loads them.


DBKit.SDK.RowsListControl.GetRowCount

GetRowCount() As Integer

Returns the number of rows the control is displaying.


DBKit.SDK.RowsListControl.GetSelectedRowIndex

GetSelectedRowIndex() As Integer

Returns the index of the control's selected row, or -1 if no row is selected.


DBKit.SDK.RowsListControl.IsValidColumnName

IsValidColumnName(columnName As String, tableName As String = "") As Boolean

Returns True if columnName is a column of the given table. When tableName is empty, the control's own table is meant. DBKit asks this when it builds the query that loads the control's rows, so that only columns that exist are included.


DBKit.SDK.RowsListControl.LoadRelatedRows

LoadRelatedRows(currentRow As DBKit.Row)

Called by DBKit when the control displays rows related to its layout's table: it loads the rows related to currentRow, the layout's current row.


DBKit.SDK.RowsListControl.ManageRowChangedEvent

ManageRowChangedEvent(index As Integer, columnIndex As Integer = -1, rowEditMode As Boolean = False)

Called by DBKit when a value in the control's row at index has changed, so the control can record the change and the layout can be told. columnIndex is the column that changed, or -1 when the change is not tied to one column; rowEditMode says whether the row is being edited.


DBKit.SDK.RowsListControl.MoveFocusToCellAt

MoveFocusToCellAt(row As Integer, column As Integer)

Called by DBKit to move the editing focus to the cell at the given row and column.


DBKit.SDK.RowsListControl.NewRow

NewRow()

Called by DBKit to have the control create a new row, ready to be edited.


DBKit.SDK.RowsListControl.PrimaryKeyAt

PrimaryKeyAt(index As Integer) As String

PrimaryKeyAt(index As Integer, Assigns value As String)

Returns, or sets, the primary key value of the row at index.


DBKit.SDK.RowsListControl.PrimaryKeyColumnNameForTable

PrimaryKeyColumnNameForTable(tableName As String) As String

Returns the name of the primary key column of the given table. DBKit asks this when it builds the query that loads the control's rows, so the primary key column is always included.


DBKit.SDK.RowsListControl.PrimaryKeyRowIndex

PrimaryKeyRowIndex(primaryKey As String) As Integer

Returns the index of the row whose primary key is primaryKey, or -1 if the control has no such row.


DBKit.SDK.RowsListControl.ReloadRow

ReloadRow(index As Integer)

Called by DBKit to have the control reload the row at index, so the displayed values match the row's current values.


DBKit.SDK.RowsListControl.RemoveAllRows

RemoveAllRows()

Called by DBKit to have the control remove every row it is displaying.


DBKit.SDK.RowsListControl.RemoveLayoutAt

RemoveLayoutAt(index As Integer)

Called by a layout as it closes, when the layout was opened from the row at index of the control, to release the control's association between that row and the layout. The row can then open a new layout the next time it is asked to. The control's record for the row is otherwise left in place.


DBKit.SDK.RowsListControl.RemoveRowAt

RemoveRowAt(index As Integer, immediately As Boolean = False)

Called by DBKit to remove the row at index from the control. When immediately is True, the row is removed from the display right away.


DBKit.SDK.RowsListControl.SetAllowSelectionChangedEvent

SetAllowSelectionChangedEvent(allow As Boolean = True)

Called by DBKit to allow or suppress the control's selection changed event, so that selection changes DBKit makes itself are not reported back to it as if the user had made them.


DBKit.SDK.RowsListControl.SetSelectedRowIndex

SetSelectedRowIndex(index As Integer)

Called by DBKit to select the row at index in the control.


DBKit.SDK.RowsListControl.UpdateRow

UpdateRow(row As DBKit.Row, index As Integer)

Called by DBKit to have the control update the row it displays at index from row.

Notes

The methods an interface requires can be implemented as Private. DBKit works with the control through the interface, so the methods do not need to be public on the control class itself.

Compatibility

Project Types

Desktop, Web

Operating Systems

All

See also

DBKit SDK overview, DBKit.Table, DBKit.SDK.Layout.