Deletes a row from the table.
Usage example:
B4X:
Sub DeleteRow (tbl As B4XTable, RowId As Long)
tbl.sql1.ExecNonQuery2("DELETE FROM data WHERE rowid = ?", Array (RowId))
Dim page As Int = tbl.CurrentPage
Dim FirstIndex As Int = tbl.FirstRowIndex
tbl.ClearDataView 'Updates the rows count.
If FirstIndex + 1 >= tbl.mCurrentCount Then
page = page - 1
End If
tbl.CurrentPage = page
End Sub
Usage example:
B4X:
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
Dim sf As Object = xui.Msgbox2Async("Delete row?", "Title", "Yes", "Cancel", "No", Null)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
DeleteRow(B4XTable1, RowId)
End If
End Sub
Last edited: