how to add column dynamically in datagridview using c#

c#, datagridview

Solution

For example:

        DataGridViewColumn col = new DataGridViewTextBoxColumn();
        col.HeaderText = "Hi there";
        int colIndex = grid.Columns.Add(col);

Problem

how to add column dynamically in datagridview using c#

Original source