如何在消息框中获取DataGridView单元格值? [英] How to get DataGridView cell value in messagebox?
本文介绍了如何在消息框中获取DataGridView单元格值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获取要在C#中的MessageBox中写入的DataGridView单元格值?
How can I get DataGridView cell value to be written in the MessageBox in C#?
推荐答案
You can use the DataGridViewCell.Value Property to retrieve the value stored in a particular cell.
因此,要检索第一个"选定单元格的值并显示在MessageBox中,您可以:
So to retrieve the value of the 'first' selected Cell and display in a MessageBox, you can:
MessageBox.Show(dataGridView1.SelectedCells[0].Value.ToString());
以上可能并非您真正需要做的.如果您提供更多详细信息,我们可以提供更好的帮助.
The above probably isn't exactly what you need to do. If you provide more details we can provide better help.
这篇关于如何在消息框中获取DataGridView单元格值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文