Set column width using attribute (ComponentModel?) in class which I bind on DataGridView (C#, WinForms)
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.
精彩评论