Android Question MSDynamicGridView with viewpager

Discussion in 'Android Questions' started by apty, Jan 1, 2019.

  1. apty

    apty Active Member Licensed User

    I am trying to programmaticaaly create grids and load them in a viewpager (https://www.b4x.com/android/forum/threads/viewpager-cleaned-up-viewpager.75342/)

    I have created the grids as shown below
    Code:
    For k = 0 To dynamicgrid2.Length - 1

            dynamicgrid2(k).Initialize(
    "DGK")
        DynamicAdapter2(k).Initialize(
    "DAK",NumCols, 90%x/NumCols, 100%x/NumCols)
    -----
    The grids are created. How do i get the current grid in the below event (i.e grid at position k). The sub below only returns the event for one grid but i have 4 grids.

    Code:
    Sub DAK_GetContent(Position As Int, ItemID As Long, ItemTag As String, ContentPanel As PanelAs Panel
    '    Log("Pos: " & Position & " ItemID: " & ItemID & " ItemTag: " & ItemTag)
       
        
    Dim lbl2 As Label= ContentPanel.GetView(1)
        lbl2.Text=ItemTag
        lbl2.textColor = 
    Colors.White
       
        
    Return ContentPanel
       
    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