table colwdith doesn't work at device

pochero

Member
Licensed User
table.ColWidth doesn't work at my device. It works ok at desktop with the same code. Is this a known issue?
windows mobile 6.1
net compact framework 2.0

Thank you and sorry for my english
 

pochero

Member
Licensed User
The problem is when I use "table1.LoadXML". It works well from the basic4ppc interface. It does not work if I compile for Windows or for the device.

B4X:
Sub Globals
   'Declare the global variables here.
   Dim size(7)
   size() = Array (5,10,15,20,40,80,120)
End Sub

Sub App_Start
   AddTable ("Form1", "table1", 0, 0, 240, 130)
   table1.LoadXML (AppPath & "\" & "data.xml")
   
   For i=0 To ArrayLen (size())-1
      'table1.AddCol (cString, i, 1)
      table1.ColWidth(table1.ColName(i)) = size(i)
   Next

   Form1.Show
   
   'table1.SaveXML (AppPath & "\" & "data.xml")
End Sub

rename data.txt as data.xml
Thank you
 

Attachments

  • data.txt
    787 bytes · Views: 216

Erel

B4X founder
Staff member
Licensed User
Longtime User
I see this behavior too. There seems to be a difference between the way different versions of .Net Framework handle tables loaded with LoadXML. You can use the legacy compiler instead of the optimized compiler and it should work properly.
However I recommend you to switch to LoadCSV / SaveCSV. It is faster and more reliable.
 
Top