Embedding Grids
| Movie | Cast | ||||||||
|---|---|---|---|---|---|---|---|---|---|
|
|
||||||||
|
Embedding a TwoColumnGrid
@(await Html
.SimpleGrid(Model.Take(2))
.AddColumn(column => column
.Header("Movie")
.Css(css => css.Item.AddStyle("max-width: 330px;"))
.TwoColumnGrid(model => model))
.AddColumn(column => column
.For(movie => movie.Cast)
.DisplayAsList(movie => movie.Cast))
.RenderAsync())
| Movie | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||
|
Embedding a TwoColumnGrid (again)
@(await Html
.SimpleGrid(Model.Take(2))
.AddColumn(column => column
.Header("Movie")
.TwoColumnGrid((movie, builder) =>
{
builder.AddRow("Name", movie.Name);
builder.AddRowsForModel(movie, builder => builder
.AddRowFor(movie => movie.Name)
.AddRowFor(movie => movie.Director)
.AddRowFor(movie => movie.Genre)
.AddRowFor(movie => movie.Released));
}))
.RenderAsync())
| Name | Released | Cast | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Star Wars | 1997 |
|
||||||||||||||||||
| Reservoir Dogs | 1992 |
|
||||||||||||||||||
Embedding a SimpleGrid
@(await Html
.SimpleGrid(Model.Take(2))
.AddColumnFor(movie => movie.Name)
.AddColumnFor(movie => movie.Released)
.AddColumn(col => col
.For(movie => movie.Cast)
.SimpleGrid(
movie => movie.Cast?.AsQueryable(),
grid => grid.AddColumnsForModel()))
.RenderAsync())