Set the column width using the attribute (ComponentModel?) In the class that I am linking to the DataGridView (C #, WinForms)

I have a DataGridView. I link there List. ObjectA has some properties. For example, ID, Name and SortOrder. I want to display the columns in the following order: SortOrder then Name. I know if installed

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

then this property will not be displayed as a column in the DataGridView. I know that if I installed

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

Where can I get the whole list of attributes that I can use for a DataGridView?

+5
source share
1 answer

No DisplayIndexAttributeto use. You must create your own.

If necessary, I can add the code.

0

All Articles