如何在字符串中获取datagridview的内容 [英] How to get contents of a datagridview in a string
本文介绍了如何在字符串中获取datagridview的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个datagridview。每个单元格都写有一个名称。
我的要求是:
如果我点击一个单元格,那个单元格中的名字应该以字符串形式提取。
我没有想法怎么做。
请建议。
I have a datagridview. Every cell has a name written in it.
My requirement is :
If I click on a cell, the name in that cell should be fetched in a string.
I have no idea how to do it.
Kindly suggest.
推荐答案
试试这个
Try this
private void your_dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
string cell_value=your_dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
}
问候..
Regards..
这篇关于如何在字符串中获取datagridview的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文