editing datagridview cells - Programmers Heaven

Howdy, Stranger!

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


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

If myDataTable.Rows.Count > 0 Then

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

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

datagridview1.CurrentCell = datagridview1(2, 0)

datagridview1.DataSource = myDataTable
End If


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


Sign In or Register to comment.