iOS Question Custom Cell - TableView help!!

Discussion in 'iOS Questions' started by MarcelloCSI, May 21, 2015.

  1. MarcelloCSI

    MarcelloCSI Active Member Licensed User

    Goodmorning Everyone.

    I need to implement in my app a Tableview with custom cell.
    I've read the discussion "TableView with custom items" starded by Erel but i could not understand many things...

    I need to a customCell with a Label and a Textfield, i created a panel with them through the Layouts Designer. They are placed in a Design called "CustomCell".

    Every time i debug the code i'm obtaining only one row without the custom layout.
    I need to add custom cell dinamically, dependings on TCP listener results.

    Here's my code :
    Public Sub LoadPage(Caller As Page, impiantoSelezionato As Int, selezione As Int)

        chiamante = Caller
        impianto = impiantoSelezionato
        selez = selezione
    If Not(myPage.IsInitialized) Then
    End If
        Main.ActivePage = myPage
    'theme color[/INDENT]
        Main.ColoreTema = 2

        table.RowHeight = PnlCell.Height
    End Sub

    Private Sub LoadData
        proto.Xpanel.WifiOn = 
        proto.ForceDdns = 
    If selez = 1 Then
    'request a type of data
        Else If selez = 2 Then
    'request another type of data
        End If
    End Sub

    Private Sub createCell(ID As Int, add As StringAs Panel
    Dim p As Panel
        p.Width = PnlCell.Width
        p.Height = PnlCell.Height
    Return p
    End Sub

    #Region "Letture da centrale"
    'Response from TCP listener

    Sub XpResponse_NomiGruppi(arg As LinkedList, CmdXp As XpCmd)
    Dim i As Int

    'Arg.size is the number of custom cell that i've to create
    'Arg.size depends on my server response.
    'CmdXp isn't implemented yet
    For i=0 To arg.Size -1
    Dim tc As TableCell = table.AddSingleLine("")
            tc.ShowSelection = 
            tc.CustomView = createCell(i, arg.Get(i))
    End Sub

    #End Region

    arg.size is always > 10

    I need also to modify the Cells's textfields and labels values

    Thnaks in advance for your answare
  2. imbault

    imbault Well-Known Member Licensed User

  3. MarcelloCSI

    MarcelloCSI Active Member Licensed User

    That Sub is called after data receiving of another module is completed
  4. MarcelloCSI

    MarcelloCSI Active Member Licensed User

    Solved thanks... It was the page resize