Such a task: when clicking on a column in the dataGridView, its title (for example, Column1, etc.) should be placed in the List.

Give pliz a hint how to do this, what to implement?

    1 answer 1

    Very simple, you just need to handle the click event on the column header. Well and, accordingly, in it add the name of the column that was clicked in the listBox .

     private void dataGridView1_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { listBox1.Items.Add(dataGridView1.Columns[e.ColumnIndex].HeaderText); }