Class

|                    |
|--------------------|
| DBKit.DeleteButton |

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton

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

# Description

Deletes the current row of the database table assigned to the button.

When the button is pressed, the user is asked to confirm the deletion before the current row is deleted.

Only the members declared by <span class="title-ref">DBKit.DeleteButton</span> itself are described here; for the inherited members, see `the parent classes<dbkit.deletebutton.seealso>`.

# Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                      | Type                               | Read-Only | Shared |
|-----------------------------------------------------------|------------------------------------|-----------|--------|
| `DeleteRelatedRows<dbkit.deletebutton.deleterelatedrows>` | `Boolean</api/data_types/boolean>` |           |        |
| `TableName<dbkit.deletebutton.tablename>`                 | `String</api/data_types/string>`   |           |        |

# Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                             | Parameters | Returns                          | Shared |
|--------------------------------------------------|------------|----------------------------------|--------|
| `TableName<dbkit.deletebutton.tablename-method>` |            | `String</api/data_types/string>` |        |

# Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                | Parameters                                   | Returns                          |
|-----------------------------------------------------|----------------------------------------------|----------------------------------|
| `Error<dbkit.deletebutton.error>`                   |                                              | `String</api/data_types/string>` |
| `RowChanged<dbkit.deletebutton.rowchanged>`         | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowCreated<dbkit.deletebutton.rowcreated>`         | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowDeleted<dbkit.deletebutton.rowdeleted>`         | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowEditing<dbkit.deletebutton.rowediting>`         | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowLoaded<dbkit.deletebutton.rowloaded>`           | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowNotSelected<dbkit.deletebutton.rownotselected>` |                                              |                                  |
| `RowSaved<dbkit.deletebutton.rowsaved>`             | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowSaving<dbkit.deletebutton.rowsaving>`           | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |
| `RowUndone<dbkit.deletebutton.rowundone>`           | row As `DBKit.Row</api/databases/dbkit/row>` |                                  |

# Property descriptions

<div id="dbkit.deletebutton.deleterelatedrows">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.DeleteRelatedRows

**DeleteRelatedRows** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the rows related to the deleted row are deleted as well.
>
> The default is `False</api/language/false>`.

<div id="dbkit.deletebutton.tablename">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.TableName

**TableName** As `String</api/data_types/string>`

> The name of the database table whose current row this button deletes.

# Method descriptions

<div id="dbkit.deletebutton.tablename-method">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.TableName

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

> Returns the name of the database table for this control: the `TableName<dbkit.deletebutton.tablename>` property if set, otherwise the table name of the control's layout.

# Event descriptions

<div id="dbkit.deletebutton.error">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.Error

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

> A DatabaseException occurred when the control attempted to delete the current row.
>
> Implement this event to display your own error message instead of DBKit's default message. Return the message to display, or return an empty string to display no message at all. If you do not implement this event, DBKit displays a default error message.

<div id="dbkit.deletebutton.rowchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowChanged

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

> The current row (passed to the event) has been changed.

<div id="dbkit.deletebutton.rowcreated">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowCreated

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

> A new row (passed to the event) was just created and is now the current row.

<div id="dbkit.deletebutton.rowdeleted">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowDeleted

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

> The current row (passed to the event) has been deleted.

<div id="dbkit.deletebutton.rowediting">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowEditing

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

> The current row (passed to the event) is being edited by the user.

<div id="dbkit.deletebutton.rowloaded">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowLoaded

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

> The current row (passed to the event) has been loaded.

<div id="dbkit.deletebutton.rownotselected">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowNotSelected

**RowNotSelected**

> There is no row currently selected.

<div id="dbkit.deletebutton.rowsaved">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowSaved

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

> The current row (passed to the event) has been saved.

<div id="dbkit.deletebutton.rowsaving">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowSaving

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

> The current row (passed to this event) is about to be saved.

<div id="dbkit.deletebutton.rowundone">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.DeleteButton.RowUndone

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

> The changes made to the current row (passed to this event) have been undone.

# Notes

## Deleting Table rows

When the button's `TableName<dbkit.deletebutton.tablename>` matches the `TableName<dbkit.deletebutton.tablename>` of a Table on the layout, pressing the button deletes the Table's selected row instead of the layout's current row.

# Compatibility

|                       |              |
|-----------------------|--------------|
| **Project Types**     | Desktop, Web |
| **Operating Systems** | All          |

<div id="dbkit.deletebutton.seealso">

<div class="seealso">

`DesktopButton</api/user_interface/desktop/desktopbutton>` (desktop) and `WebButton</api/user_interface/web/webbutton>` (web) parent classes; `DBKit.Row</api/databases/dbkit/row>` class.

</div>

</div>
