Changing DataGridView Header Text At Runtime

c#, datagridview, winforms

Solution

Dont create a datagridview column if you did something like that, if you want to change the already existing column in Datagridview, you can go for the below code. it would get change at Runtime.

dataGridView1.Columns["Old Column Name"].HeaderText = "New Grid Column Name";

                                  or

 dataGridView1.Columns[column_index].HeaderText = "New Grid Column Name";

Problem

I am able to change all of the controls texts at runtime, expect my DataGridViews header text will not changed. ``` colName.HeaderText = FormOtherRes.Crc; ``` I tried `DataGridView1.Refresh();` But it did not work. It seem working when I am debugging but the UI it not changing. How can I change my columns headerText at runtime?

Original source