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/events.md
+99
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ This article explains the events available in the Telerik TreeView for Blazor:
15
15
*[OnItemClick](#onitemclick)
16
16
*[ExpandedItemsChanged](#expandeditemschanged)
17
17
*[OnItemRender](#onitemrender)
18
+
*[OnExpand and OnCollapse](#onexpand-and-oncollapse)
18
19
19
20
## OnItemClick
20
21
@@ -304,6 +305,104 @@ If the item that is customized has children, they will also inherit the styles a
304
305
}
305
306
````
306
307
308
+
## OnExpand and OnCollapse
309
+
310
+
The `OnExpand` and `OnCollapse` events fire when the user tries to expand/collapse an item, but *before* the actual action takes place.
311
+
312
+
The `OnExpand` handler receives an argument of type `PanelBarExpandEventArgs`.
313
+
314
+
The `OnCollapse` handler receives an argument of type `PanelBarCollapseEventArgs`.
315
+
316
+
Both event arguments expose an `Item` and `IsCancelled` properties. To cancel each event, set `args.IsCancelled` to `true`. In this case, the item will gain focus and selection, but its state will remain unchanged.
0 commit comments