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;
Dim rs As ResultSet = B4XTable1.sql1.ExecQuery("SELECT rowid from data")
Do While rs.NextRow
XSelections.SelectedLines.Put(rs.GetLong("rowid"), "")
Loop
rs.Close
XSelections.Refresh
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
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