You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/panelbar/data-binding/overview.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,11 +194,13 @@ The following **Example** shows how to define simple binding to match item field
194
194
195
195
You can define different binding settings for the different levels of nodes in the PanelBar. With this, the children of a node can consume a different field than their parent, and this may make your application more flexible. If you use [hierarchical data binding]({%slug panelbar-data-binding-hierarchical%}), the children can even use a different field or model from their parent.
196
196
197
-
This also allows you to define a different [`ItemTemplate`]({%slug panelbar-templates%}) for different levels.
197
+
This also allows you to define different [header and content templates]({%slug panelbar-templates%}) for different levels.
198
198
199
199
To define multiple bindings, add multiple `PanelBarBinding` tags and define their `Level`.
200
200
201
-
If a certain level does not have an explicit data bindings tag, it will use the default one that has no level.
201
+
There can be maximum one binding for each level and one ("default") binding without a level. If multiple same-level bindings are declared, the first one is used and the rest are ignored.
202
+
203
+
If a certain level does not have an explicit data binding tag, it will use the default one that has no level.
202
204
203
205
>caption How to use per-level data binding settings to change model fields
Copy file name to clipboardExpand all lines: components/panelbar/overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ Each item in the PanelBar consists of a `Header` and `Content`. The image below
144
144
145
145
You can customize their rendering through the corresponding [Header Template]({%slug panelbar-templates-header%}) and [Content Template]({%slug panelbar-templates-content%}).
146
146
147
-
The content represents the items in the hierarchy that does not have children. If the items have children and the ContentTemplate is defined, the template will not render. The header contains the Text of the correponding data item (model).
147
+
The content represents the items in the hierarchy that do not have children. If the items have children and the ContentTemplate is defined, the template will not render. The header contains the Text of the correponding data item (model).
Copy file name to clipboardExpand all lines: components/panelbar/templates/content.md
+21-35Lines changed: 21 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,26 +10,38 @@ position: 10
10
10
11
11
## ContentTemplate
12
12
13
+
You can control and customize the rendering of the content items in the PanelBar with a `ContentTemplate`. Here is how to use it.
13
14
14
-
You can control and customize the rendering of the content items in the PanelBar. It provides a `context` object that you can cast to the type that the PanelBar is bound it.
15
+
* The `ContentTemplate` is defined under the `PanelBarBinding` tag.
16
+
* It provides a `context` object that you can cast to the type, which the PanelBar is bound to.
17
+
* The template can include other Razor components or executable code.
18
+
* Similar to [`PanelBarBinding`s]({%slug panelbar-data-binding-overview%}), there can be **one**`ContentTemplate` for all items at the same level. If the content of these items should be different, use conditional statements inside the template.
19
+
* A `ContentTemplate` displays like a child item. It is rendered only for the items, which have no children.
15
20
16
-
The `ContentTemplate` is defined under the `PanelBarBinding` tag.
17
-
18
-
>caption Use the ContentTemplate to customize the content items
21
+
>caption Use ContentTemplate to customize the content items
19
22
20
23
````CSHTML
21
-
@* Customize the rendering of the content items *@
24
+
@*Set Level 0, 1 or 2 to the PanelBarBinding to see how the content template appears for specific levels only.*@
25
+
@*Without a Level, the ContentTemplate will be applied to all items that have no children, from all levels, which don't have their own binding.*@
0 commit comments