Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
code to edit the data of grid view in the same form
i.e,
when we click on the edit button on the gridview row,the control must goes to the column of the grid view row and allow us to make changes
and then if we click on update button it should be updated on the grid
Posted
Updated 13-Dec-19 18:45pm

Refer previously solved answer:
Hi friends, C#- windows application[^]
 
Share this answer
 
Private Sub FillProductDetails()

dgvProductDetails.Rows.Clear()
Dim mdgvNRow As Integer = 0
Dim index As Integer = 0
If mProductDetailsList IsNot Nothing AndAlso mProductDetailsList.Count <> 0 Then
For Each item As ProductDetails In Me.ProductDetailsList
With item
mdgvNRow = dgvProductDetails.Rows.Add
Dim mRow As DataGridViewRow = dgvProductDetails.Rows(mdgvNRow)
mRow.Cells("colProductName").Value = .ProductName
mRow.Cells("colCode").Value = .Code
mRow.Cells("colExpiryDateTime").Value = .ExpiryDateTime
mRow.Cells("colAvailable").Value = .Available
mRow.Cells("colProductRate").Value = .ProductRate
mdgvNRow = mdgvNRow + 1

End With
Next
End If

End Sub

Private Sub frmStudentDetails_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
FillProductDetails()
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900