最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

a column value change in datagridview appears as the last row in the re-loaded grid while changed row is unchanged - Stack Overf

programmeradmin5浏览0评论

I have an unbound datagridview(DGV) with 7 columns. The last column is a button column. When the DGV loads, a blank row appears at the bottom for the user to enter data. Upon button click the the DGV is saved to a file. I want the user to be able to change a value in any row and upon re-load of the grid have the changed row appear in its original place with the changes. I am able to change values in a row but upon button click when a change is made to a row value the re-loaded DGV displays the changed row as the last row in the grid as well as the original unchanged row in its proper place. I know I can use textboxes to add ,modify ,delete cell contents but I want to be able to change values directly in the grid. Any help would be appreciated.

I have tried using cellBeginEdit and cellEndEdit to save the changes but it doesn't work. The changed row still appears as the last row of the grid upon re-load and the original row remains unchanged.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论