c# Hide a property in datagridview with datasource
attributes, c#, datasource
Solution
If you are adding the columns yourself... don't add the columns you don't want.
If you have `AutoCreateColumns` enabled, then:
- if it is a class-based model, add `[Browsable(false)]` to properties you don't want
- or set the column's `.Visible` to false
- or simply remove the columns you don't want afterwards
Problem
I think there must be an attribute to hide a public property from the datagridview. But I can't find it.
Related problems
- Is there an Attribute I can use in my class to tell DataGridView not to create a column for it when bound to a List<MyClass>
- How to hide column of DataGridView when using custom DataSource?
- Is there an Attribute I can use in my class to tell DataGridView not to create a column for it when bound to a List<MyClass>