CheckListBox in vb.net using for Loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SEhtesham
    New Member
    • Aug 2011
    • 45

    #1

    CheckListBox in vb.net using for Loop

    hi,
    My application is in VS2008 coded in vb.net.I have a form with a datagridview which loads data from databaase.there is one column where data is stored separated by comma's.Like Name,Surname,La stName name this column as Testing.I have a checklistbox on another of my form.When the user selects a particular row from datagridview another form open and the row selected records are populated in the control of my other form.My issue is i want to check those items of my checkbox that are present in my Testing Column.I have used and array im able to fetch the records just im not able to check the items in my checklistbox that are present in the column
    Below is my code
    chkList is my checklistbox controls
    FORM1 is my form that has datagridview
    Below is the code of my second form that has checklistbox
    Code:
    Dim classesChecked As String() = FORM1.DATAGRIDVIEW.Item(10,FORM1.DATAGRIDVIEW.CurrentCell.RowIndex).Value.ToString.Split(",")
     
    For i As Integer = 0 To classesChecked.Length - 1
    Next
    Please suggest how can i check the items of my checklistbox.
  • SEhtesham
    New Member
    • Aug 2011
    • 45

    #2
    hi frnds..
    im done with my issue,
    here is the code
    Code:
    checklistbox.SetItemChecked(checklistbox.FindString(classesChecked(i).Trim), True)
    thanks

    Comment

    Working...