Interface

# DBKit.SDK.RowDataControl

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Implemented by a control that displays and edits one column of a row, such as the built-in TextField, CheckBox and Slider, and the Rating control in the DBKit example project. It extends `DBKit.SDK.RowBase</api/databases/dbkit/sdk/rowbase>`, so a control implementing it also provides the RowBase methods and receives row events through `DBKit.SDK.RowEventReceiver</api/databases/dbkit/sdk/roweventreceiver>`.

DBKit works with the control in both directions. When a row is loaded or its values change, DBKit calls UpdateControlFromRow so the control can display the row's value for its column. When the row is saved, DBKit calls UpdateRowFromControl so the control can write its value into the row. Before a save, DBKit also asks the control whether its column must have a value and whether its current value is valid.

## `Methods</getting_started/using_the_xojo_language/methods>`

<div class="rst-class">

methods-table

</div>

| Name                                                                  | Parameters                                         | Returns                            |
|-----------------------------------------------------------------------|----------------------------------------------------|------------------------------------|
| `GetColumnName<dbkit.sdk.rowdatacontrol.getcolumnname>`               |                                                    | `String</api/data_types/string>`   |
| `GetDisplayName<dbkit.sdk.rowdatacontrol.getdisplayname>`             |                                                    | `String</api/data_types/string>`   |
| `HasValidValue<dbkit.sdk.rowdatacontrol.hasvalidvalue>`               |                                                    | `Boolean</api/data_types/boolean>` |
| `IsMandatory<dbkit.sdk.rowdatacontrol.ismandatory>`                   |                                                    | `Boolean</api/data_types/boolean>` |
| `UpdateControlFromRow<dbkit.sdk.rowdatacontrol.updatecontrolfromrow>` | row As `DBKit.Row</api/databases/dbkit/row>` = Nil |                                    |
| `UpdateRowFromControl<dbkit.sdk.rowdatacontrol.updaterowfromcontrol>` | row As `DBKit.Row</api/databases/dbkit/row>`       |                                    |

## Method descriptions

<div id="dbkit.sdk.rowdatacontrol.getcolumnname">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl.GetColumnName

**GetColumnName**() As `String</api/data_types/string>`

> Returns the name of the database column the control displays and edits. DBKit uses it to read the control's value from a row and to write it back.

<div id="dbkit.sdk.rowdatacontrol.getdisplayname">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl.GetDisplayName

**GetDisplayName**() As `String</api/data_types/string>`

> Returns the name DBKit uses when it refers to the control's column to the user, for example in the message shown when a mandatory column has no value.

<div id="dbkit.sdk.rowdatacontrol.hasvalidvalue">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl.HasValidValue

**HasValidValue**() As `Boolean</api/data_types/boolean>`

> Returns True if the control's current value can be saved. DBKit checks this, together with IsMandatory, before a row is saved; a row whose controls do not all have valid values is not saved.

<div id="dbkit.sdk.rowdatacontrol.ismandatory">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl.IsMandatory

**IsMandatory**() As `Boolean</api/data_types/boolean>`

> Returns True if the control's column must have a value before the row can be saved.

<div id="dbkit.sdk.rowdatacontrol.updatecontrolfromrow">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl.UpdateControlFromRow

**UpdateControlFromRow**(row As `DBKit.Row</api/databases/dbkit/row>` = Nil)

> Called by DBKit when the control should display the value of its column from *row*. When *row* is Nil, there is no current row and the control should clear itself.

<div id="dbkit.sdk.rowdatacontrol.updaterowfromcontrol">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.SDK.RowDataControl.UpdateRowFromControl

**UpdateRowFromControl**(row As `DBKit.Row</api/databases/dbkit/row>`)

> Called by DBKit when the row is being saved, so the control can write its current value into *row*, in the column named by GetColumnName.

## Notes

A control whose value the user can change directly should not wait for UpdateRowFromControl to record the change. As soon as its value changes, it should pass itself to its layout's UpdateCurrentRow method, as the built-in controls do. DBKit broadcasts a row event when any control on the layout is edited, and the other controls respond by reloading their values from the row; a control that has not yet written its change into the row will be reloaded with the row's previous value and the user's change will appear to revert.

The methods an interface requires can be implemented as Private, as the Rating example control does. 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          |

<div id="dbkit.sdk.rowdatacontrol.seealso">

<div class="seealso">

`DBKit SDK</api/databases/dbkit/sdk>` overview, `DBKit.SDK.RowDataImageControl</api/databases/dbkit/sdk/rowdataimagecontrol>`, `DBKit.SDK.Layout</api/databases/dbkit/sdk/layout>`.

</div>

</div>
