How to set column header text for specific column in Datagridview C#

Mark picture Mark · Jun 24, 2009 · Viewed 140.8k times · Source

How to set column header text for specific column in Datagridview C#

Answer

Marc Gravell picture Marc Gravell · Jun 24, 2009

For info, if you are binding to a class, you can do this in your type via DisplayNameAttribute:

[DisplayName("Access key")]
public string AccessKey { get {...} set {...} }

Now the header-text on auto-generated columns will be "Access key".