• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

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
0
jmrasmus
Asked:
jmrasmus
  • 2
1 Solution
 
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now