B4J Question Horizonal scroll tableview from code

shhammer5634

Member
Licensed User
Longtime User
I have a tableview in an existing program that due to a change now has greater than 100 columns. I would like to be able to preset the viewable area to a specific column from code rather than have the person viewing the table have to do it manually. I've looked at ScrollTo, but that's for Rows. I've also tried to select a cell that is in the column I want to show, but that doesn't seem to do it either. My search of the forum didn't turn up what I was looking for.

Is there any way to do this without having to rewrite and use a different control, or am I out of luck?

Thanks for the help.
 

Daestrum

Expert
Licensed User
Longtime User
There is a scrollToColumnIndex for the TableView
Untested code - uses javaobject library
B4X:
Dim jo As JavaObject = yourTableView
jo.RunMethod("scrollToColumnIndex",array(29))   ' scroll so 30th column is visible
 
Upvote 0
Top