Text from iOSCustomTableCell selection

  1. 5 months ago

    Carl F

    Jul 20 Pre-Release Testers, Xojo Pro Webster, NY USA

    I have a simple iOSCustomTableCell with a iOSLabel named StreetLabel
    How do you access the text of StreetLabel when a user clicks on the cell in a multi row iOSCustomTableCell?
    I am using the Action event of the iOSCustomTableCell

    I have started with this in the custom tables action event

    dim cell as iOSCustomTableCell = Me.RowData(section,row).Control

    but cannot figure out how to get the text from StreetLabel

    The easiest is to store the text in the iOSTableCellData.tag

    To specifically answer your question this should help:

    Dim cell As iOSTableCellData = me.RowData(section, row)
    
    if cell.Control isa iOSCustomTableCell then
      
    Dim customCell As iOSCustomTableCell = iOSCustomTableCell(cell.Control)
    Dim street As Text = customCell.StreetLabel
    
    end if
  2. Jeremie L

    Jul 21 Pre-Release Testers, Xojo Pro, XDC Speakers Answer Europe (France) - getpackr.io
    Edited 5 months ago

    The easiest is to store the text in the iOSTableCellData.tag

    To specifically answer your question this should help:

    Dim cell As iOSTableCellData = me.RowData(section, row)
    
    if cell.Control isa iOSCustomTableCell then
      
    Dim customCell As iOSCustomTableCell = iOSCustomTableCell(cell.Control)
    Dim street As Text = customCell.StreetLabel
    
    end if
  3. Carl F

    Jul 22 Pre-Release Testers, Xojo Pro Webster, NY USA

    @Jeremie L - very nice - thank you

or Sign Up to reply!