diff --git a/components/filter/events.md b/components/filter/events.md index a8dc8fe6ff..a11a675e6e 100644 --- a/components/filter/events.md +++ b/components/filter/events.md @@ -12,13 +12,67 @@ position: 11 This article explains the available events for the Telerik Filter for Blazor: +* [OnUpdate](#onupdate) * [ValueChanged](#valuechanged) +## OnUpdate + +The `OnUpdate` event fires when the user changes the Filter `Value`. The component is designed for one-way binding and works directly with the object reference of the bound `CompositeFilterDescriptor`. The component updates the `Value` internally. Use the `OnUpdate` event to handle any additional logic when the Filter `Value` is modified. + +>caption Handle OnUpdate + +````RAZOR +@using Telerik.DataSource + +
Change any filter value to trigger the event and see the message update from the OnUpdate handler.
+ + + + + + + + +
+
+ @EventMessage +
+ + + +@code { + private CompositeFilterDescriptor Value { get; set; } = new CompositeFilterDescriptor(); + private string EventMessage { get; set; } = string.Empty; + + private void OnFilterUpdate() + { + EventMessage = $"Filter updated at {DateTime.Now:HH:mm:ss}"; + } + + public class Person + { + public int EmployeeId { get; set; } + public string Name { get; set; } = string.Empty; + public int AgeInYears { get; set; } + } +} +```` + ## ValueChanged The `ValueChanged` event fires when the value has changed. Its event handler receives the updated `CompositeFilterDescriptor` as an argument. ->caption Handle ValueChanged. +> The `ValueChanged` event is deprecated and will be removed in future versions. Use the `OnUpdate` event instead. + +>caption Handle ValueChanged ````RAZOR @* This code snippet showcases an example of how to handle the ValueChanged event. *@