本文介绍了如何在datagridview中使单元格可编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在处理库存,我想在运行时更改我的金额 费率* Quantiy =金额 所以我想要在乘法后改变我的运行时间金额,请尽量让我成为儿子 我的代码如下:i am working on inventory , i want to change my amount on run time meanRate* Quantiy=Amountso i want to change my amount on run time after multiplying , pleas giude me as son as possiblemy code is given belowif (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()); } } } }推荐答案 这篇关于如何在datagridview中使单元格可编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-13 19:38