DataGridView Cell Value Change Not Happening
I have retrieved data from access database into a DataGridView. Let 开发者_如何学JAVAus 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.
You most likely need to pick up the EditedFormattedValue
of the cell, which has the new value. FormattedValue
and Value
have the original value.
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.
精彩评论