S Sanxion Active Member Licensed User Longtime User May 21, 2016 #1 Hi all I would like to convert a B4a listview to a tableview: I load the listview using the following: lvLessons.AddSingleLine("Chapter1") lvLessons.AddSingleLine("Chapter2") etc... I have defined a tableview and initialized it. Do I need to use table cells in order to add the lines? Thanks
Hi all I would like to convert a B4a listview to a tableview: I load the listview using the following: lvLessons.AddSingleLine("Chapter1") lvLessons.AddSingleLine("Chapter2") etc... I have defined a tableview and initialized it. Do I need to use table cells in order to add the lines? Thanks
Erel B4X founder Staff member Licensed User Longtime User May 22, 2016 #2 All items are made of TableCells however you can ignore this fact and just add the items with: B4X: tv.AddSingleLine("Chapter1") Upvote 0
All items are made of TableCells however you can ignore this fact and just add the items with: B4X: tv.AddSingleLine("Chapter1")
S Sanxion Active Member Licensed User Longtime User May 22, 2016 #3 Erel said: All items are made of TableCells however you can ignore this fact and just add the items with: B4X: tv.AddSingleLine("Chapter1") Click to expand... This is what I did initially but then couldn't determine how to handle the "click event" of the TableView and what arguments that event would take. Could you give an example please? Upvote 0
Erel said: All items are made of TableCells however you can ignore this fact and just add the items with: B4X: tv.AddSingleLine("Chapter1") Click to expand... This is what I did initially but then couldn't determine how to handle the "click event" of the TableView and what arguments that event would take. Could you give an example please?
S Sanxion Active Member Licensed User Longtime User May 22, 2016 #4 I have found one way of doing it: B4X: Sub lvLessons_SelectedChanged (SectionIndex As Int, Cell As TableCell) Dim text As AttributedString = Cell.Text End Sub Upvote 0
I have found one way of doing it: B4X: Sub lvLessons_SelectedChanged (SectionIndex As Int, Cell As TableCell) Dim text As AttributedString = Cell.Text End Sub
Erel B4X founder Staff member Licensed User Longtime User May 23, 2016 #5 Note that you can use the Tag property to store data: B4X: Dim tc As TableCell = tv.AddSingleLine(...) tc.Tag = any value you like Later you can get it in the SelectedChanged event. Upvote 0
Note that you can use the Tag property to store data: B4X: Dim tc As TableCell = tv.AddSingleLine(...) tc.Tag = any value you like Later you can get it in the SelectedChanged event.