标签: c# mysql datagridview textbox header
当我在DataGridView中选择特定单元格时,如何在文本框中显示列标题?
答案 0 :(得分:3)
试试这个:
int idx = this.dataGridView1.SelectedCells[0].ColumnIndex; this.textBox1.Text = this.dataGridView1.Columns[idx].HeaderText;