Hi Alls,

I really need help from u all regarding how to update database using checkbox in datagridview.... i got 4 columns from my access database that is:-

Columns1 = Id
Coulmn2 = Name
Columns3 = Status
Columns4 checkbox =

I need to update any data in column that have checked...how to that...can anyone help me?...plzzzzzzzzzzzz

for Each gvrow As GridViewRow in GridView1.Rows)
Dim cb As CheckBox = (CheckBox)gvrow.FindControl("CheckBox1")
          Dim chkstate As Boolean = cb.Checked
            'perform ur action(updation)
            if (chkstate = true)
                            'updation
                break
            end If
       Next

Mmmm.....confius because got problem, can explain more

how have you placed checkboxes in GridView? using template feilds?

Already had with this code:,

Dim column As DataGridViewColumn = New DataGridViewCheckBoxColumn
column = New DataGridViewCheckBoxColumn
column.DataPropertyName = "STATUS"
column.Name = "RECOMMENDED ?"

Me.DataGridView1.Columns.Add(column)
Me.DataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter

so how to update the database?..ekekekeke...tq

Please help me......

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.