Find/replace column names in gridview at runtime

Hi,

Can somebody show me how to do a find/replace on the columns of a gridview at runtime? I want to check for certain column names, and rename them.

Thanks
zattzAsked:
Who is Participating?
 
drypzConnect With a Mentor Commented:
Hi! Like this...

            foreach (DataGridViewColumn col in dataGridView1.Columns)
            {
                if (col.Name == "theName")
                    col.Name = "newName";
            }
0
 
zattzAuthor Commented:
thx
0
All Courses

From novice to tech pro — start learning today.