473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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,LastName 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
Expand|Select|Wrap|Line Numbers
  1. Dim classesChecked As String() = FORM1.DATAGRIDVIEW.Item(10,FORM1.DATAGRIDVIEW.CurrentCell.RowIndex).Value.ToString.Split(",")
  2.  
  3. For i As Integer = 0 To classesChecked.Length - 1
  4. Next
  5.  
Please suggest how can i check the items of my checklistbox.
Sep 17 '11 #1

✓ answered by SEhtesham

hi frnds..
im done with my issue,
here is the code
Expand|Select|Wrap|Line Numbers
  1. checklistbox.SetItemChecked(checklistbox.FindString(classesChecked(i).Trim), True)
  2.  
thanks

1 2606
hi frnds..
im done with my issue,
here is the code
Expand|Select|Wrap|Line Numbers
  1. checklistbox.SetItemChecked(checklistbox.FindString(classesChecked(i).Trim), True)
  2.  
thanks
Sep 17 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rejimonb | last post by:
Can I fill a combobox without using a loop. Using a loop will be time consuming. Reji
3
by: nico3334 | last post by:
I'm filling in a Report with SQL data using VB code. I'm using LOOP and MoveNext. Before using MoveNext, I would like to be able to check whether the new data is equal to the previous data that was...
1
by: python101 | last post by:
I would like to use loop 'for' to make something look like ------ * * * * * * * * * * #(please don't mind ----- because I can not type the first star in right position) however I...
1
by: bhavanirayala | last post by:
Hi, How can I get the hash values without loop? i.e I want to assign the value of a first key to one variable based on the condition.If that condition falis i need to assign the second value...
5
by: boss1 | last post by:
hi all, i have a problem with loop in select statement.i m using code : <select name = "s" size = "1" > <option selected>P-Code</option> <option...
1
by: xukaifeng | last post by:
Hi guys, I retrieve books from a database and put each book with its data into a bean. this works well, the beans are called bookBeanBeg1, bookBeanBeg2, bookBeanBeg3, bookBeanBeg4, etc. ...
1
by: smepperson | last post by:
Can anyone help explain this in simple terms. My textbok is useless... Have to code a Loop that will check if a name you are adding to a CheckedListBox has already been entered , if not add name...
5
by: dave816 | last post by:
Sorry for the Excel question in an Access forum...................I don't see an Excel forum and there's probably a reason for that but figured I'd give this a shot anyway. Again sorry, delete if...
1
by: Donnie Seibel | last post by:
I wrote a script to list all lines in a file with Perl. I am having trouble with the looping part of it. My script is supposed to look at the file and as long as the file is larger than the current...
0
by: rohit shekhar | last post by:
hi, i have to take 3 property in windows form using 3 textbox.i have to bind arraylist to datagrid.but i have to to show only 2 columns and hide the third one.i use visual studio 2003 and need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.