Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

editing datagridview cells

svibuksvibuk Posts: 10Member

Dim cmd As New SqlCommand(SQLSTR, conn)
reader = cmd.ExecuteReader()

Dim myDataTable As New DataTable
myDataTable.Load(reader)

If myDataTable.Rows.Count > 0 Then

datagridview1.DataSource = myDataTable
datagridview1.Columns(2).HeaderText = "QUANTITY"

datagridview1.AllowUserToAddRows = False
datagridview1.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2

datagridview1.Focus()
datagridview1.CurrentCell = datagridview1(2, 0)
datagridview1.BeginEdit(True)

Else
datagridview1.DataSource = myDataTable
End If

m_reader.Close()
cmd.Dispose()

i hve the follwoing code by which i bind the data to the grid
the grid has 4 columns PRODUCTNAME, QTY,RATE, AMOUNT

the user shld be able to edit the data in the column qty for as many rows it has
but i m not able to edit this column
how do i edit the values in the cells of column(1) ie qty

Comments

Sign In or Register to comment.