From 7e9728c0324b16a6abd614e5ef59b7ed2862b9fe Mon Sep 17 00:00:00 2001 From: Tsvetomir Hristov <106250052+Tsvetomir-Hr@users.noreply.github.com> Date: Wed, 2 Jul 2025 13:49:12 +0300 Subject: [PATCH 1/4] chore(Filter): document OnUpdate event --- components/filter/events.md | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/components/filter/events.md b/components/filter/events.md index a8dc8fe6ff..684e433fc6 100644 --- a/components/filter/events.md +++ b/components/filter/events.md @@ -12,12 +12,52 @@ 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 filter value changes. The component works directly with the bound `CompositeFilterDescriptor` value and automatically updates it when it is used with one-way binding. + +>caption Handle OnUpdate. + +````RAZOR +@using Telerik.DataSource + + + + + + + + +
+OnUpdate triggered count: @TriggeredOnUpdateCount + +@code { + private CompositeFilterDescriptor Value { get; set; } = new CompositeFilterDescriptor(); + private int TriggeredOnUpdateCount { get; set; } + + private void OnFilterUpdate() + { + TriggeredOnUpdateCount++; + } + + public class Person + { + public int EmployeeId { get; set; } + public string Name { get; set; } + 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. +> The `ValueChanged` event will be deprecated in future versions. Use the `OnUpdate` event instead. + >caption Handle ValueChanged. ````RAZOR From e3ed33d1ef9c5dc53c005d0ec3d74b32c944cd6e Mon Sep 17 00:00:00 2001 From: Tsvetomir Hristov <106250052+Tsvetomir-Hr@users.noreply.github.com> Date: Wed, 2 Jul 2025 14:51:49 +0300 Subject: [PATCH 2/4] chore: apply review recommendations --- components/filter/events.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/components/filter/events.md b/components/filter/events.md index 684e433fc6..890c874a14 100644 --- a/components/filter/events.md +++ b/components/filter/events.md @@ -17,13 +17,15 @@ This article explains the available events for the Telerik Filter for Blazor: ## OnUpdate -The `OnUpdate` event fires when the filter value changes. The component works directly with the bound `CompositeFilterDescriptor` value and automatically updates it when it is used with one-way binding. +The `OnUpdate` event fires when the filter value changes. The component is designed for one-way binding and works directly with the reference of the bound `CompositeFilterDescriptor` value. Avoid using two-way binding, because the component updates the filter value internally. Use the `OnUpdate` event to handle any additional logic when the filter value is modified. ->caption Handle OnUpdate. +>caption Handle OnUpdate ````RAZOR @using Telerik.DataSource +
Change any filter value to trigger the event and see the message update from the OnUpdate handler.
+ @@ -32,21 +34,33 @@ The `OnUpdate` event fires when the filter value changes. The component works di
-OnUpdate triggered count: @TriggeredOnUpdateCount +
+ @EventMessage +
+ + @code { private CompositeFilterDescriptor Value { get; set; } = new CompositeFilterDescriptor(); - private int TriggeredOnUpdateCount { get; set; } + private string EventMessage { get; set; } = string.Empty; private void OnFilterUpdate() { - TriggeredOnUpdateCount++; + EventMessage = $"Filter updated at {DateTime.Now:HH:mm:ss}"; } public class Person { public int EmployeeId { get; set; } - public string Name { get; set; } + public string Name { get; set; } = string.Empty; public int AgeInYears { get; set; } } } @@ -58,7 +72,7 @@ The `ValueChanged` event fires when the value has changed. Its event handler rec > The `ValueChanged` event will be deprecated in future versions. Use the `OnUpdate` event instead. ->caption Handle ValueChanged. +>caption Handle ValueChanged ````RAZOR @* This code snippet showcases an example of how to handle the ValueChanged event. *@ From c7609769891dc8e42c76d324387630a9fbf0b69a Mon Sep 17 00:00:00 2001 From: Tsvetomir Hristov <106250052+Tsvetomir-Hr@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:16:23 +0300 Subject: [PATCH 3/4] Update components/filter/events.md Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> --- components/filter/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/filter/events.md b/components/filter/events.md index 890c874a14..d62365aa0a 100644 --- a/components/filter/events.md +++ b/components/filter/events.md @@ -17,7 +17,7 @@ This article explains the available events for the Telerik Filter for Blazor: ## OnUpdate -The `OnUpdate` event fires when the filter value changes. The component is designed for one-way binding and works directly with the reference of the bound `CompositeFilterDescriptor` value. Avoid using two-way binding, because the component updates the filter value internally. Use the `OnUpdate` event to handle any additional logic when the filter value is modified. +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 From 41954998075951f9b064e7949c9e0d9122b29cd2 Mon Sep 17 00:00:00 2001 From: Tsvetomir Hristov <106250052+Tsvetomir-Hr@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:16:30 +0300 Subject: [PATCH 4/4] Update components/filter/events.md Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> --- components/filter/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/filter/events.md b/components/filter/events.md index d62365aa0a..a11a675e6e 100644 --- a/components/filter/events.md +++ b/components/filter/events.md @@ -70,7 +70,7 @@ The `OnUpdate` event fires when the user changes the Filter `Value`. The compone The `ValueChanged` event fires when the value has changed. Its event handler receives the updated `CompositeFilterDescriptor` as an argument. -> The `ValueChanged` event will be deprecated in future versions. Use the `OnUpdate` event instead. +> The `ValueChanged` event is deprecated and will be removed in future versions. Use the `OnUpdate` event instead. >caption Handle ValueChanged