i have a simple class like below. And a List<Person>
. I bind this list to the DataGridView
in the Form.
class Person {
public int ID {get; set;}
public string Name { get; set; }
public string Surname { get; set; }
[DisplayName("Birth Date")]
public DateTime BDate { get; set; }
}
With Attribute DisplayName
i can change column header text.
My question is
Is there any Attribute to hide the ID
Property of the Person
?
AND SECOND QUESTION (UPDATED)
Is there any Attribute to change the order of this properties when bind the list to the grid?