如何在datagridview中使单元格可编辑? [英] how to make cell editable in datagridview ?
本文介绍了如何在datagridview中使单元格可编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在处理库存,我想在运行时更改我的金额
费率* Quantiy =金额
所以我想要在乘法后改变我的运行时间金额,请尽量让我成为儿子
我的代码如下:
i am working on inventory , i want to change my amount on run time mean
Rate* Quantiy=Amount
so i want to change my amount on run time after multiplying , pleas giude me as son as possible
my code is given below
if (dgDetail.CurrentRow != null)
{
if (dgDetail.CurrentRow.Cells["Qty"].Value != null && dgDetail.CurrentRow.Cells["Rate"].Value != null)
{
if (dgDetail.CurrentRow.Cells["Qty"].Value != null && dgDetail.CurrentRow.Cells["Qty"].Value.ToString().Trim() != "" && Convert.ToDecimal(dgDetail.CurrentRow.Cells["Qty"].Value) > 0)
{
decimal GAmount = Convert.ToDecimal(dgDetail.CurrentRow.Cells["Rate"].Value.ToString()) * Convert.ToDecimal(dgDetail.CurrentRow.Cells["Qty"].Value.ToString());
dgDetail.CurrentRow.Cells["Amount"].Value = Convert.ToDecimal(GAmount);
if (dgDetail.CurrentRow.Cells["STPercent"].Value != null)
{
dgDetail.CurrentRow.Cells["SaleTax"].Value = GAmount / 100 * Convert.ToDecimal(dgDetail.CurrentRow.Cells["STPercent"].Value.ToString());
if (dgDetail.CurrentRow.Cells["OtherSTP"].Value != null)
{
dgDetail.CurrentRow.Cells["OtherST"].Value = GAmount / 100 * Convert.ToDecimal(dgDetail.CurrentRow.Cells["OtherSTP"].Value.ToString());
dgDetail.CurrentRow.Cells["Total"].Value = GAmount + Convert.ToDecimal(dgDetail.CurrentRow.Cells["SaleTax"].Value.ToString())+Convert.ToDecimal(dgDetail.CurrentRow.Cells["OtherST"].Value.ToString());
}
}
}
}
推荐答案
访问这里....
http://www.daniweb.com/software-development/csharp/threads/297772/datagridview-editable [ ^ ]
< br $> b $ b
或...
[ ^ ]
visit here....
http://www.daniweb.com/software-development/csharp/threads/297772/datagridview-editable[^]
or...
How to make a column in datagridview editable[^]
这篇关于如何在datagridview中使单元格可编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文