I change single cells with this code to a textfield (to let the user edit it inside the table). This works like a charm
Problem here is that there are two events fired:
First the actual clicked cell and as a second one row 0 cell 0.
It seems that the first cell is always selected automatically when you update the row. This causes the 2nd event to be fired. As you can click on that cell, you can't check it by code if it is really clicked (except you filter it as first and second event). Is there a way to prevent this behaviour? I did not find a setting.
B4X:
Sub DevicesTV_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object)
Log("Actual Row: " & RowIndex & " Column: " & ColIndex)
If ColIndex=0 Then Return
Dim actualrow(DevicesTV.ColumnsCount) As Object = DevicesTV.Items.Get(RowIndex)
Dim tf As TextField
tf.Initialize("")
tf.Text=Cell
actualrow(ColIndex)=tf
Log("Changed: " & ColIndex)
actualrow(ColIndex)=tf
DevicesTV.Items.Set(RowIndex,actualrow)
End Sub
Problem here is that there are two events fired:
B4X:
Actual Row: 0 Column: 5
Changed: 5
Actual Row: 0 Column: 0
First the actual clicked cell and as a second one row 0 cell 0.
It seems that the first cell is always selected automatically when you update the row. This causes the 2nd event to be fired. As you can click on that cell, you can't check it by code if it is really clicked (except you filter it as first and second event). Is there a way to prevent this behaviour? I did not find a setting.