Dim cmd As New SqlCommand(SQLS TR, conn)
reader = cmd.ExecuteRead er()
Dim myDataTable As New DataTable
myDataTable.Loa d(reader)
If myDataTable.Row s.Count > 0 Then
datagridview1.D ataSource = myDataTable
datagridview1.C olumns(2).Heade rText = "QUANTITY"
datagridview1.A llowUserToAddRo ws = False
datagridview1.E ditMode = DataGridViewEdi tMode.EditOnKey strokeOrF2
datagridview1.F ocus()
datagridview1.C urrentCell = datagridview1(2 , 0)
datagridview1.B eginEdit(True)
Else
datagridview1.D ataSource = 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
reader = cmd.ExecuteRead er()
Dim myDataTable As New DataTable
myDataTable.Loa d(reader)
If myDataTable.Row s.Count > 0 Then
datagridview1.D ataSource = myDataTable
datagridview1.C olumns(2).Heade rText = "QUANTITY"
datagridview1.A llowUserToAddRo ws = False
datagridview1.E ditMode = DataGridViewEdi tMode.EditOnKey strokeOrF2
datagridview1.F ocus()
datagridview1.C urrentCell = datagridview1(2 , 0)
datagridview1.B eginEdit(True)
Else
datagridview1.D ataSource = 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
Comment