error with table1.SelectCell

schimanski

Well-Known Member
Licensed User
Longtime User
I have a problem with saving then last used index of my table-control:

I save the last used index of the table1 in an ini-file with

B4X:
FileWrite(c1,table1.SelectedRow)     'dataindex

With a new start of the application, the table should show the last index, which was in use. I load the table with

B4X:
If FileExist("Datenbank.xml")=True Then table1.LoadXML("Datenbank.xml")

and want to show the last index (dataindex) with:

B4X:
table1.TableSort ("Modul ASC")
table1.SelectCell("Modul",dataindex)

But I always get this error message:
 

Attachments

  • error.JPG
    error.JPG
    14.8 KB · Views: 191

agraham

Expert
Licensed User
Longtime User
I think this is happening because you are trying to set up the Table in App_Start before you have Shown the form containing it. As the Form is only built when it is first Shown the Table can't select a cell because the Table itself does not yet exist as it is only built when the Form is built.
 
Last edited:
Top