开发者

Set column width using attribute (ComponentModel?) in class which I bind on DataGridView (C#, WinForms)

开发者 https://www.devze.com 2023-02-28 11:29 出处:网络
I have DataGridView. I bind there a List. ObjectA have some properties. For example ID, Name and SortOrder.

I have DataGridView. I bind there a List. ObjectA have some properties. For example ID, Name and SortOrder. I want to display columns in next order: SortOrder then Name. 开发者_Python百科I know if set

[Browsable(False)]
public int ID { get; set; }

then this property will not appear in DataGridView as column. I know that if I set

[DisplayName("N")]
public int SortOrder{ get; set; }

Where I can get all list of such attributes which I can use for DataGridView?


There is no DisplayIndexAttribute to use. You should create your own.

If needed I can add the code.

0

精彩评论

暂无评论...
验证码 换一张
取 消