0
votes

I have retrieved data from access database into a DataGridView. Let us suppose I am in Row 0. When I change the contents of Row 0, Cell 1 and press a button, the Update query should modify that row, but I am unable to modify the value of the cell. The cell maintains its previous value and the database is not modified. For example, if I change the contents of a cell from "David" to "Jhon", how can I change the value of the cell from "David" to "Jhon"? I am using VB.NET 2008.

2
Stack Overflow is a community-owned Q&A site. All the answers to your question will be posted here, so that anyone who has the same problem later can find them. Personal emails are discouraged for that reason. Also, can you post the code you're currently trying to use to do this? - Cody Gray♦

2 Answers

1
votes

You most likely need to pick up the EditedFormattedValue of the cell, which has the new value. FormattedValue and Value have the original value.

0
votes

I presume you are checking the formatted value of the cell for getting the value. Also if you are changing the values, please check if the cell value changed event is triggered or not. Coz the editing control needs to pass the changed value back to the grid cell. If you can post your code then it might be more clear and helpful.