Column Headers
Name | Movie Director | GENRE |
---|---|---|
Star Wars | George Lucas | Sci-Fi |
Reservoir Dogs | Quentin Tarantino | Thriller |
Airplane! | David and Jerry Zucker and Jim Abrahams | Slapstick |
@(await Html
.SimpleGrid(Model.Take(3))
// Sets the Header from an Expression
.AddColumn(col => col.For(movie => movie.Name))
// Set Header Expression directly
.AddColumn(col => col
.HeaderFor(movie => movie.Director)
.DisplayAs(movie => movie.Director))
// Define an explicit Header
.AddColumn(col => col
.Header("GENRE")
.DisplayAs(movie => movie.Genre))
.RenderAsync())
The Header Expression will resolve the name in the following progression:
- Display Name Attribute if it exists
- DisplayName Attribute if it exists
- Name of the Property