I would like someone to help me bind data with a CheckBox. Please furnish sample code if possible. I am using VB 2008 Net 3.5.

I want to use several checkboxes to identify records within a name $ address masterfile. Any given name can be identified in one or mre ways. For example John Smith can be an employee, a vender or a client.

I have setup seven fields in my database as bits and in data sources I have labeled them as CehcekBoxes. However, I can not bind a CheckBox to a field.

Any help you can provide or refer me to will be appreciated.

Keith@LPG

Hi!

>>>>I have setup seven fields in my database as bits and in data sources I have labeled them as CehcekBoxes. However, I can not bind a CheckBox to a field.

You can fill dataset from your database and can create a datagridview column. Then set its "DataPropertyName" property to database's checkbox Column. Here "IsActiveColumn" is a bit field in SQL.

Dim col As New DataGridViewCheckBoxColumn
        col.DataPropertyName = WareHouseDataSet.tblOrder.IsActiveColumn
        DataGridView1.Columns.Add(col)

I didn't get this part:

>>>>>>I want to use several checkboxes to identify records within a name $ address masterfile. Any given name can be identified in one or mre ways. For example John Smith can be an employee, a vender or a client.

Shahan Dev
Thank you for responding to my post about binding CheckBoxes. I need to let you know a couple of things that may allow you to give a clearer answer appropriate to my needs.
First I am using a detail view, not a data grid view.
Second in the part you don't understand a single record in my name & address data base can be identifeied as an employee using a CheckBox labeled Employee, and as a vender using a CheckBox labeled Vendor and as a client with a CheckBox labeled Client.
A second response from you will be greatley appreciated.

keith@LPG

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.