vellaima Posted February 21, 2003 Posted February 21, 2003 I have set the checkboxes for ListView to true. During run time whenever the user clicks each checkbox i would like to get the status of the particular checkbox. Can this be done. Please Help. Quote
*Gurus* divil Posted February 21, 2003 *Gurus* Posted February 21, 2003 The ListView has an ItemCheck event which should trigger every time a checkbox is checked or cleared. You can then see whether it is checked using e.CurrentValue. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
vellaima Posted February 21, 2003 Author Posted February 21, 2003 Can you please tell me how to get the selected items in a string that are checked Quote
*Gurus* divil Posted February 21, 2003 *Gurus* Posted February 21, 2003 Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck Dim l As ListViewItem Dim s As String = "" For Each l In ListView1.CheckedItems 'Do whatever you like with this item If s.Length = 0 Then s &= l.Text Else s &= "," & l.Text Next End Sub Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
vellaima Posted February 21, 2003 Author Posted February 21, 2003 I would like to select only one item and store it in string array. The ListView as Multiple columns. Can you please provide me with a code. Quote
Heiko Posted February 21, 2003 Posted February 21, 2003 In this case you have too loop through the listitem's collection of subitems. Quote .nerd
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.