0

Good day!

I have a listview loaded in a form in a lvwIcon view with checkboxes enabled.. I have checked some items from it, let say 5 items. Now when I switch the view to lvwReport, the checked items are gone. How to make it selected again?

Thank you for helping!

2
Contributors
2
Replies
9
Views
2 Years
Discussion Span
Last Post by blocker
0

Store the checked items in an array. After changing the viewtype varify and check them programmatically.
The codes should be like

Dim x as Integer = 0
For litm As ListViewItem in ListView1.Items
    For i As Integer = x to UBound(LitmArray)
        If litm.Text = LitmArray(i) Then
            litm.Checked = True
            x += 1
        End If
    Next

    If x>= UBound(LitmArray) Then
        Exit For
    End If
Next
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.