当我在DataGridView中选择特定的单元格时,如何在文本框中显示列标题?
Try this:
int idx = this.dataGridView1.SelectedCells[0].ColumnIndex;
this.textBox1.Text = this.dataGridView1.Columns[idx].HeaderText;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.