【发布时间】:2019-02-24 21:53:13
【问题描述】:
我的问题是,当我单击“价格”列下的单元格时,它只会在文本框中显示数据网格的内容,该单元格的“货币数据类型”除 ItemNo 为 Varchar(100) 之外的所有其他单元格。请帮忙,谢谢
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewRow row = this.dataGridView1.CurrentRow;
txtDsc.Text = row.Cells["Description"].Value.ToString();
txtQty.Text = row.Cells["Qty"].Value.ToString();
txtUnt.Text = row.Cells["Unit"].Value.ToString();
txtPrc.Text = row.Cells["Price"].Value.ToString();
txtRmr.Text = row.Cells["Remarks"].Value.ToString();
}
【问题讨论】:
-
为什么将代码发布为图片?
-
这里的新手不知道如何道歉
-
好的,欢迎来到 Stackoverflow :) 以下是您可能想阅读的内容:stackoverflow.com/help/how-to-ask,这是提问时要记住的最重要事项的清单:codeblog.jonskeet.uk/2012/11/24/…
-
请不要将您的代码发布为图像,因为这会导致无法复制和粘贴,并且搜索引擎难以索引。提问时最好包括您的代码、预期输出、当前错误以及您可能尝试过的任何步骤。这将使社区更容易为您提供帮助。
-
注明。我已经编辑了我的问题:) 谢谢
标签: c# datagridview textbox cell display