How to create a table with fixed row / column

barx

Well-Known Member
Licensed User
Longtime User
I would like to create a screen that has a scrollable table but the top row and left-most column to be always visable. Much like fixing column/rows in excel. How would I go about this. Only thing I can think of is to use a listview for the column and link it in code to the position of the grid(table) and position it so it looks like it's part of the same table. Dont know about the top row though as this would be horizontal scrolling??

Any hints, tips or pointers to tutorials. Thanks
 

klaus

Expert
Licensed User
Longtime User
Do you need to scroll the the table horizontaly ?
This is not simply possible, there is no table control in B4A that you can scroll vertically or horizontally, so this must be done by code.
For the horizontal top row, you find several examples in ScrollView examples summary. For the left column I would suggest a ScrollView instead of a ListView.

Best regards.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
you seem to certainly know your stuff Klaus. I've been reading the tutorials and forums and kind of figured it wasn't an easy task. Think I may use the 'table example' (with gridlines) and maybe put <- and -> arrows at bottom to create a 'paging' effect. Should be very adequate.

Thanks
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
... and maybe put <- and -> arrows at bottom to create a 'paging' effect.
That's what I was also thinking of.

I suggested for the left column a Scrollview because the table would be a ScrollView too so when you scroll one of those you could read its ScrollPosition and set the other one to this value. Haven't tried it, but should work.

Best regards and good luck.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
That's what I was also thinking of.

I suggested for the left column a Scrollview because the table would be a ScrollView too so when you scroll one of those you could read its ScrollPosition and set the other one to this value. Haven't tried it, but should work.

Best regards and good luck.

Sounds logical. cheers
 
Upvote 0
Top