Twin runtime-generated tables with diferent behaviours

Cableguy

Expert
Licensed User
Longtime User
Hi guys,....

I have two twin runtime-generated tables...
This is their runtime-generation code:
B4X:
   AddTable("Panel2","Table1",100,100,400,250)
   Table1.AddCol(cString, "Entidade",0)
   Table1.AddCol(cString, "Equipamento", 198)
   Table1.AddCol(cString, "N.Serie", 198)
   Table1.HeaderVisible=False
   AddEvent("Table1", SelectionChanged, "Main.Table1_SelectionChanged")
B4X:
   AddTable("Panel3","Table2",100,150,400,200)
   Table2.AddCol(cString, "Equipamento", 99)
   Table2.AddCol(cString, "N.Serie", 99)
   Table2.AddCol(cString, "DataSaida",0)
   Table2.AddCol(cString, "Tecnico",99)
   Table2.AddCol(cString, "Ord.Trab",99)
   Table2.HeaderVisible=False
   AddEvent("Table2", SelectionChanged, "Main.Table2_SelectionChanged")
The only diference is the number of collums added to the tables...
The issue is that, table1.headervisible=false woks fine, BUT, table2.headervisible does nothing...WHY?!?
 

Cableguy

Expert
Licensed User
Longtime User
I have tried it but no luck there!
Here's my complete code WITHOUT ANY DLL!!!
 

agraham

Expert
Licensed User
Longtime User
I think it is as I said. You are building the Tables before displaying the Form and so the tables don't necessarily exist to have their headers hidden. Try putting a temporary Button on the form that hides the headers when it is pressed. I think you will find that that works so you will need to find a way to hide the headers after doing FormEx.Run. Putting it in App_Start after the Run won't work for a FormEx because the Run only returns to App_Start after the application is closed so any code after Run only gets executed as the program dies.
 

Cableguy

Expert
Licensed User
Longtime User
I have placed it in the Select Case (lines 52 to 106 of the Main Module) wich gets trigered upon a Slider button gets clicked, so all the controls are created by then...and it didn't work!
 

agraham

Expert
Licensed User
Longtime User
I'm afraid that I don't have time to locate and download those other libraries but it has got to be some sort of timing/control existence problem. If you can't sort it then if you post a stripped down version that demonstrates the problem without using all those libraries I'll take another look.
 

agraham

Expert
Licensed User
Longtime User
OK I got it working. I think it is a timing thing about when the Table control is actually built and what state it thinks the state of its header visibility is.

If you remove the line Table2.HeaderVisible=False from Components.Initialize and put it instead after Case "button2" it works OK.
 

Cableguy

Expert
Licensed User
Longtime User
Thanks Andrew!!!

I had tried that, but I didn't remove it from the components module, so it didn't work...
I will be posting this as a bug, since if both lines are present, the prop is ignored, even thou they are the same!
 
Top