1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

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

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

  1. Roberto P.

    Roberto P. Well-Known Member Licensed User

    Hello to all,
    when I click on a particular cell change color (ok it works), but how much change the line resets the standard color.
    Is there a way to preserve the color and prevent spade changed the color of the cell?

    upload_2015-11-21_22-52-26.png

    upload_2015-11-21_22-55-11.png

    Use this function for change the color

    Sub Table1_CellClick(Col As Int, Row As Int)

    If mTableOpenOrder.visibleRows.ContainsKey(Row) Then
    Dim lbls() As Label
    lbls = mTableOpenOrder. visibleRows.get(Row)
    lbls(3).Color = Colors.Green
    End If

    end sub
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    TableView is optimized for large tables. It recycles the views.
    You cannot just change the label color as the same label will be later used for a different cell.

    If the table is not too large and you need more customization then it will be easier to implement a similar table with CustomListView (which doesn't
    reuse views).
     
  3. Roberto P.

    Roberto P. Well-Known Member Licensed User

    Hello Erel
    thank you, I understand.
    But custom listview has some features that I need:

    - Sorting columns
    - Horizontal scrolling

    Find an alternative solution.
    Greetings
     
  4. staticmike

    staticmike Member Licensed User

    Love the table class library and figured most of it out apart from how to change the row colours ?
    I would like to change the Cyan colour to one that matches my app and have looked through the code trying to find a clue as to where this cyan colour is coming from.

    I thought it might be something like -

    table1.RowColor2 = Colors.Magenta

    Any help would be appreciated.

    Thanks
     
  5. Mahares

    Mahares Well Known Member Licensed User

    I am pretty sure it is this line in the class module. Change it to a different color other than cyan if you want:
    cRowColor2 = 0xFF98F5FF
     
    Last edited: Feb 26, 2016
  6. klaus

    klaus Expert Licensed User

    Which version of the Table class are you using ?
    The last version is 1.43.
    In this version the row colors are properties, like:
    Table1.RowCol1 = Colors.Red
    Table1.RowCol2 = Colors.Blue
     
    Last edited: Mar 7, 2016
  7. staticmike

    staticmike Member Licensed User

    Thanks Klaus.
    Looks like i'm on version 1.1. I will try again and thanks again for the quick response.
     
  8. deyvitm

    deyvitm Member Licensed User

    someone has some example of a grid column where you can have as a button or a link, when you click go to an event and can run something, I hope I can help
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    The CellClick event is raised when the user clicks on a cell.
     
    deyvitavara likes this.
  10. deyvitavara

    deyvitavara New Member Licensed User

    Excelent erel,
    But I can add a button or an image in a column for that row by row you see the image and you can give specific click for a more ideal design theme , thanks
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    TableView is optimized for large tables. It reuses the labels when you scroll the table. This makes it difficult to customize.

    If your data is not too large than you can use CustomListView instead to implement a custom table.
     
  12. deyvitm

    deyvitm Member Licensed User

    Excelent Erel,

    Thx.
     
  13. tamayo461

    tamayo461 Member Licensed User


    Hi @Merlot2309 i have a problem when i try to delete the last Row, the app close without error. do you know for what?
     
  14. klaus

    klaus Expert Licensed User

    There exist a newer version of the TableView in this thread.
     
  15. vbmundo

    vbmundo Well-Known Member Licensed User

    Hi,

    I'm using your Class, and have a problem creating a second Table in other Layout..

    This is my first Table and works fine

    g.Initialize(Me, "g", 2)

    And this is my second Table

    gc.Initialize(Me ,"gc",4)

    Of any reason, the second Initialize don't set the NumberOfColumns value correctly.

    When I debug the code the NumberOfColums property by 0 after the Initialize

    What's Wrong ?

    Regards
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Hard to say without seeing the code. There should be no problem adding multiple tables.
     
  17. vbmundo

    vbmundo Well-Known Member Licensed User

    Hi

    I see the problem... I turn to LandsCope before create the Table using the Phone class

    In Portrail works good, but when you change the orientation before doesn't work.

    Obviously this is a bug.

    I need to show a long table in Landscope, but this don't work with this Table Class

    Regards
     
  18. Erel

    Erel Administrator Staff Member Licensed User

  19. vbmundo

    vbmundo Well-Known Member Licensed User

    Yes, but Look

    I has this line before create the TAB

    MyPhone.SetScreenOrientation(0)

    And the Table turn the columns in '0'

    when I quit this line... all works fine...
     
  20. klaus

    klaus Expert Licensed User

    You should post your project as a zip file, so we can see what exactly you have done and find the solution!
     
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