TableView - handle click?

Alex69

Member
Licensed User
Longtime User
Hi,
I have a question about using tableview click. It isn't so obvious how to use it(there are no comments in the class). Can someone explain me how to handle it?
Alex
 

klaus

Expert
Licensed User
Longtime User
Are you speeking of Erels' Table Class ?
If yes you have the Table1_CellClick and Table2_CellClick events returning the column and row indexes so know where in the table you are. And with Table1.GetValue(col, rowl) you get the content of a cell.

Best regards.
 
Last edited:
Upvote 0

Alex69

Member
Licensed User
Longtime User
As far as I understood class searches xxx_cellclick event or I am mistaken?
B4X:
Private Sub Cell_Click
   Dim rc As RowCol
   Dim l As Label
   l = Sender
   rc = l.Tag
   SelectRow(rc.Row)
   If SubExists(Callback, Event & "_CellClick") Then
      CallSub3(Callback, Event & "_CellClick", rc.Col, rc.Row)
   End If
End Sub
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Here is one way to do it:
Add the following sub to the Table class module:
B4X:
Public Sub RowCount As Int
   Return Data.Size
End Sub

Then, in your main module do this:
B4X:
Dim Table1 as Table
Dim RecCount as Int
.
.
RecCount=Table1.RowCount
Msgbox(RecCount,"")     'returns the number of records in your table.
 
Upvote 0
Top