TableModel

Description

sealed class Tinman.Engine.GUI.Components.TableModel<TValue>

Derived from

DataModelBase<IVectorConst<TValue>> abstract

Model for a DataGrid that represents a table of equally typed values.

Public / Constructors

Table​Model


public constructor TableModel → (1)

columns in : int32

[>0]
The columns count.

Creates a new instance of TableModel.

Public / Methods

Add


public method Add → (1)

row opt : int32 = -1

[-1..IDataModel.Rows]
The insertion index. If -1, the value of IDataModel.Rows will be used.

returns → int32

Index of new table row.

Adds a new table row with default values.

Clear


public method Clear → ()

Removes all table rows.

Get


public method Get → (2)

row in : int32

[0..IDataModel.Rows-1]
The row index.

column in : int32

[0..TableModel.Columns-1]
The column index.

returns → TValue

The current value or null.

Gets a table value.

Remove


public method Remove → (1)

row in : int32

[0..IDataModel.Rows-1]
The row index.

Removes a table row.

Set


public method Set → (3)

row in : int32

[0..IDataModel.Rows-1]
The row index.

column in : int32

[0..TableModel.Columns-1]
The column index.

value in : TValue

The new value.

Sets a table value.

Public / Attributes

Columns


public attribute Columns → (get)

value : int32

[>0]
The column count.

The number of table columns.