S
S
Sergey Khlopov2019-08-31 12:29:22
C++ / C#
Sergey Khlopov, 2019-08-31 12:29:22

How to make two way communication between DataGridView and ArrayList?

Hello, please tell me, there is a task:


To sort an array and search for an element, use the methods of the ArrayList class. To manipulate the contents of an array, it is mandatory to use a two-way relationship with the DataGridView.

How to make two-way communication?
// Клик по пункты "Создать => ввод"
        private void вводToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ArrayList list = new ArrayList();
            dataGridView1.Visible = true;
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.DataSource = list;
        }

I do like this, but it's dataGridView1empty and I can't add new values ​​there, see form screenshot below
5d6a3ddcaabb5723252508.png
Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question