Android Question B4x table add row after current selected row

Bapha

Member
Hello friends,
How can we insert new row after the (below) current selected row in B4X table. For example we have 4 items in B4X table, i click first row and insert new row should be go to second row of B4X table. Here is sample picture what i am looking for.

Named1.jpg


Named2.jpg


Thanks in advance.
 

Mahares

Expert
Licensed User
Longtime User
insert new row should be go to second row of B4X table
You can't simply insert a record below the selected record because the B4XTable data displayed is stored in a SQLite in-memory database and the record goes to the end of the table.
But what you can do is add an internal sort to the column in question say in this case it is called: 'Make'. When you define the columns and their data type that column will be defined like this:
B4X:
B4XTable1.AddColumn("Make", B4XTable1.COLUMN_TYPE_TEXT).InternalSortMode = "ASC"
After you insert the new record, the table gets automatically sorted by that column and the record is displayed below the one with the same make.
 
Upvote 0
Top