在datagridview中编辑和更新一行 [英] Edit and update a row in datagridview

查看:153
本文介绍了在datagridview中编辑和更新一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海,

我在c#中的Windows应用程序中开发项目.我在datagridview中有Items,Rate,Qty,Total列.我想更改rate和qty的值.我还想在更改值后计算净额.我可以将此记录更新到数据库吗?请帮帮我.


问候
Ananya

Hai,

Iam developping a project in windows application in c#.I have the columns Items,Rate,Qty,Total in datagridview.I want to change the values of rate and qty.And also I want to calculate the Net amount after changing the values.How can i update this record to the database.Please help me.


Regards
Ananya

推荐答案

您好,

不太清楚这是否是您要寻找的东西...
Hi there

Don''t quite know if this is what you are looking for...
dataGridView1.Rows[0].SetValues("5","t","4","3");


其中0是行索引.
所以第一行是零.
我没有在那儿给出任何真实的值

您还可以编辑单个单元格,例如


Where the 0 is the row index.
So zero is first row.
I didn''t give any real values there

you can also edit individual cells e.g.

dataGridView1[0, 0].Value = "Hi there";



希望对您有所帮助:)



Hope this helps :)


您好Ananya

我希望以下链接一定能解决您的问题.



在ASP.NET中可编辑GridView [在ASP.NET中编辑各个GridView单元格 [
Hi Ananya

I hope the following link will surely solve ur problem .



Editable GridView in ASP.NET[^]

Edit Individual GridView Cells in ASP.NET[^]

Happy codding ...:)

Seshu


这篇关于在datagridview中编辑和更新一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆