Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim gg As xnGrid
Dim tt As xnTable
End Sub
Sub Activity_Create(FirstTime As Boolean)
'
tt.Initialize ( Array As String ( "Anz" , "PLU" , "Name" , "Preis" ) )
For r = 0 To 1
tt.Append ( Array As String ( "a" & r , "b" & r , "c" & r , "12.50" ) )
Next
''Here I can add a new row without any problems
tt.Insert ( Array As String ( "3" , "125" , "Cola mit Eis 0,3" , "2.50" ),0)
tt.Insert ( Array As String ( "2" , "122" , "Cola mit Fanta 0,3" , "2.50" ),0)
'
gg.Initialize("gg")
' gg.HeaderHeight=50
' gg.RowEvenColor = Colors.Green
' gg.RowOddColor = Colors.Red
' gg.Color = colors.DarkGray
' gg.SelectedEvenColor = Colors.Yellow
Dim c0 As xnGridCol
Dim c1 As xnGridCol
Dim c2 As xnGridCol
Dim c3 As xnGridCol
gg.RowHeight = 50dip
c0.Initialize ( "Anz." , "Anz" , 50dip )
c0.Gravity=Gravity.LEFT
gg.Columns.Add ( c0 )
c1.Initialize ( "PLU." , "PLU" , 50dip )
gg.Columns.Add ( c1 )
c2.Initialize ( "Speisename" , "Name" , 150dip )
gg.Columns.Add ( c2 )
c3.Initialize ( "€" , "Preis", 70dip)
c3.Gravity=Gravity.RIGHT
gg.Columns.Add ( c3 )
Activity.AddView ( gg , 0dip , 130dip , 400dip , 300dip )
gg.GridCreate ( tt )
Activity.LoadLayout("Test")
End Sub
'Here I would like to add a new row, but not happens
Sub Button1_Click
tt.Insert ( Array As String ( "2" , "122" , "Eistee 0,3" , "2.50" ),0)
End Sub