Layout
<Layout> arranges the form declared by <EditorFields>.
Controls nest; if the top-level controls are <Tab>s the form renders as a wizard/stepper.
| Element | Attributes | Holds |
|---|---|---|
<Tab> |
Title, Page, Validate |
sections / grids / items |
<Section> |
Label, IsAccordian, IsExpanded |
items / lines / grids |
<Item> |
Name (field), Width (1–12), ViewOnlyLabel |
— (a single field) |
<Line> |
Render |
— (a separator / new row) |
<Sub> |
Name (a SubView), Width |
— (embeds a child grid; for cart line-items use CartTable SubView="…" instead) |
<Grid> → <Row> → <Column> |
Column Span (1–12, default 12) |
explicit 12-column grid; columns hold items / nested grids / subs |
<Item Name="…"> references an editor field by name; Width controls its span within the enclosing
section (1–12). Use a <Grid>/<Row>/<Column> block when you need an explicit 12-column layout —
each <Column Span="…"> holds items or nested grids.
<Layout> <Section Label="Identity"> <Item Name="Name" Width="6" /> <Item Name="CategoryId" Width="6" /> </Section> <Section Label="Pricing"> <Grid> <Row> <Column Span="4"><Item Name="UnitPrice" Width="12" /></Column> <Column Span="4"><Item Name="UnitCost" Width="12" /></Column> <Column Span="4"><Item Name="Margin" Width="12" /></Column> </Row> </Grid> </Section> <Section Label="Movements"> <Sub Name="ProductStockMovements" Width="12" /> </Section></Layout><Sub Name="…">embeds a child grid — see Sub-views. For cart line-items, prefer<CartTable SubView="…">(see CartTable) over a standalone<Sub>.- Placing a
<CartTable>in the layout uses a single<Item Name="{cart}" />— the cart drives all three modes itself (see the CartTable page).
Worked example: sample/Inventory/models/views/Products.view.xml (<Tab>/<Section> with a nested
<Grid>/<Row>/<Column> and a <Sub> child grid).