Android Question B4Xtable select row Programmatically

Mostez

Well-Known Member
Licensed User
Longtime User
I use B4XTableSelections to multiple select\deselect rows by user, i want to add 'select all\select non feature' in my code regarding if these rows are the original rows or filtered (search result). how to select\deselect rows programmatically? something like;

B4X:
for each row in table
     row.select
next
 

Mostez

Well-Known Member
Licensed User
Longtime User
thanks Erel, here is the code with slight modification with respect to search results, it selects rows OK, any ideas how to deselect them?

B4X:
tblPhoneContacts.sql1.ExecQuery("SELECT rowid from data")
Dim o() As Object = tblPhoneContacts.BuildQuery(False) 'True to include the page LIMIT in the query.
Dim rs As ResultSet = tblPhoneContacts.sql1.ExecQuery2(o(0), o(1))
Do While rs.NextRow
   XSelections.SelectedLines.Put(rs.GetLong("rowid"), "")
Loop
rs.Close
XSelections.Refresh
 
Last edited:
Upvote 0

Mostez

Well-Known Member
Licensed User
Longtime User
ok got it, many thanks Erel

B4X:
Dim rs As ResultSet = tblPhoneContacts.sql1.ExecQuery("SELECT rowid from data")
Do While rs.NextRow
    TableStyle.SelectedLines.Remove(rs.GetLong("rowid"))
Loop
rs.Close
TableStyle.Refresh
 
Upvote 0
Top