![](/img/trans.png)
[英]How to Check Selected Row In Datagridview without Checking the Cell in C#
[英]How to check which cell in dataGridView is selected?
我想从dataGridView中的选定单元格发送多个邮件,但是不知道如何找出选中的单元格,所以问题是如何找出选中的单元格?
我可以做一些循环来遍历单元格并测试选择(选中)哪个单元格吗?
语言C#。
使用DataGridView.SelectedCells属性。
foreach(DataGridViewCell cell in dataGridView.SelectedCells)
{
//do something
}
DataGridViewSelectedCellCollection selectedCells = myDataGridView.SelectedCells;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.