[英]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.