B4A Library [Class] TableView - Supports tables of any size

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jul 4, 2012.

  1. Lyndon Bermoy

    Lyndon Bermoy Member Licensed User

    Hello good day! I tried so many codes on the table_cellclick but I cannot get the correct code on showing or selecting the rows of the table on the database because it always shows the last field/record of the database.

    Here's my code:

    Code:
    Sub Table1_CellClick (Col As Int, Row As Int)


       Main.cursor1 = Main.sql1.ExecQuery(
    "SELECT * FROM tblStudent")
    For i = 0 To Main.cursor1.RowCount - 1
    Main.cursor1.Position = 
    0
           Grading.last =Main.cursor1.GetString(
    "lname")
       Grading.first =  Main.cursor1.GetString(
    "fname")
       Grading.sub1 =  subj
       Grading.sec1 =  sec
       Grading.attendance1 = Main.cursor1.GetString(
    "attendance")
       Grading.per = rb
       Grading.quiztot =  Main.cursor1.GetString(
    "quizTotal")
       Grading.assTot =  Main.cursor1.GetString(
    "assTotal")
       Grading.project =  Main.cursor1.GetString(
    "project")
       Grading.exam =  Main.cursor1.GetString(
    "exam")
       Grading.grade=  Main.cursor1.GetString(
    "grade")
         
    StartActivity("grading")
       
         
    Next
    End Sub
    My code above shows only the last record of my database. All I wanted is that if I select the row, it will show the correct selected field to my next display but it ended up showing the last record of my database. Thanks
     
  2. klaus

    klaus Expert Licensed User

    How do you fill the table?
    Which version of the TableView class are you using?
    There exist another thread for the TableView, the latest version is 2.10
     
  3. Pantelis Loizou

    Pantelis Loizou Member Licensed User

    Hallo everyone! Need some help...Is there any way in the existing library where i can use the functionality of multiple row selection? E.g. Deletion of muliple rows instead of choosing one by one! Any info would be greatly appreciated. Thanx!
     
  4. klaus

    klaus Expert Licensed User

    Be aware that this is not a library but a Class.
    The class in this thread is an 'old' one.
    You find the more recent one in the Flexible Table thread, which has a multi select mode..
     
    spairo, Erel and DonManfred like this.
  5. advansis

    advansis Member Licensed User

    I didn't find any function to set a single column text, I simply wrote it. If you like, please add it to your shared code:

    Code:
    public Sub SetHeaderName (Col As Int, Text As String)
        
    Dim L As Label=Header.GetView(Col)
        L.Text=Text
    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice