Gridview Column title

i am using a gridview control and need to change the title of a column to the current year of 2009. any ideas?
Thanks
Jim
jmrasmusAsked:
Who is Participating?
 
CebikCommented:

DataGridView dgv = new DataGridView();
dgv.Columns.Add("col1", "col1");
dgv.Columns.Add("col2", "col2");
dgv.Columns.Add("col3", DateTime.Now.Year.ToString());
 
dgv.Columns[0].HeaderText = DateTime.Now.Year.ToString();
dgv.Columns["col2"].HeaderText = DateTime.Now.Year.ToString();

Open in new window

0
 
jmrasmusAuthor Commented:
Thanks!
0
 
CebikCommented:
you're welcome ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.