Android Question unchecking a custom listview checkbox

Discussion in 'Android Questions' started by davelt99, Mar 3, 2015.

  1. davelt99

    davelt99 Member Licensed User

    I am trying to uncheck all checkboxes in a custom listview that has a label and a checkbox on each line/panel.
    I've tried:
    For i= 0 To clvEmployees.GetSize -1
    Dim pnl As Panel
    pnl = clvEmployees.GetPanel(i)
    Dim chk As CheckBox
    chk.Initialize("")
    chk = pnl.GetView(i)
    chk.Checked = False
    Next

    but get the error message that an android.widget.textview cannot be cast to an android.widget.checkbox.

    Is there a way to reference the checkbox in the panel??

    Thank you
     
  2. davelt99

    davelt99 Member Licensed User

    Thanks in advance, I just figured it out.

    chk=pnl.GetView(i) should be chk=pnl.GetView(1)
    where the checkbox is the 2nd item in the panel.
     
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