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

后端 未结 7 1417
青春惊慌失措
青春惊慌失措 2020-12-16 09:45

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

7条回答
  •  时光说笑
    2020-12-16 10:12

    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".

提交回复
热议问题