Skip to content

Commit 05ebfbb

Browse files
Merge branch 'development' into 979389-block-editor
2 parents 27b8506 + a86476c commit 05ebfbb

File tree

5 files changed

+233
-16
lines changed

5 files changed

+233
-16
lines changed

blazor-toc.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,6 +3745,7 @@
37453745
<li> <a href="/blazor/numeric-textbox/how-to/customize-the-spin-buttons-up-and-down-arrow">Customize the spin button’s up and down arrow</a></li>
37463746
<li> <a href="/blazor/numeric-textbox/how-to/customize-the-step-value-and-hide-spin-buttons">Customize the step value and hide spin buttons</a></li>
37473747
<li> <a href="/blazor/numeric-textbox/how-to/numeric-textbox-model-binding">Numeric Textbox Model Binding</a></li>
3748+
<li> <a href="/blazor/numeric-textbox/how-to/disable-mouse-wheel-in-numeric-textbox-component">Disable Mouse Wheel in NumericTextBox</a></li>
37483749
</ul>
37493750
</li>
37503751
<li>
@@ -3971,6 +3972,7 @@
39713972
<li> <a href="/blazor/query-builder/import-export">Importing and Exporting</a></li>
39723973
<li> <a href="/blazor/query-builder/lock-group-rule">Lock Group/Rule</a></li>
39733974
<li> <a href="/blazor/query-builder/clone-group-rule">Clone Group/Rule</a></li>
3975+
<li> <a href="/blazor/query-builder/events">Events</a></li>
39743976
<li> <a href="/blazor/query-builder/localization">Localization</a></li>
39753977
<li> <a href="/blazor/query-builder/style-and-appearance">Styles and Appearances</a></li>
39763978
<li> <a href="/blazor/query-builder/accessibility">Accessibility</a></li>

blazor/calendar/special-dates.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ Customize specific dates in a [Blazor Calendar](https://www.syncfusion.com/blazo
2929
public DateTime? CurrentDate { get; set; } = DateTime.Now;
3030
public void CustomDates(RenderDayCellEventArgs args)
3131
{
32-
var CurrentMonth = CurrentDate.Value.Month;
33-
if (args.Date.Month == CurrentMonth && (args.Date.Day == 7 || args.Date.Day == 14 || args.Date.Day == 24 || args.Date.Day == 29)) {
34-
args.CellData.ClassList += " personal-appointment";
35-
}
36-
if (args.Date.Month == CurrentMonth && (args.Date.Day == 3 || args.Date.Day == 11 || args.Date.Day == 17 || args.Date.Day == 22))
37-
{
38-
args.CellData.ClassList += " official-appointment";
32+
if (args.CurrentView == "Month") {
33+
var CurrentMonth = CurrentDate.Value.Month;
34+
if (args.Date.Month == CurrentMonth && (args.Date.Day == 7 || args.Date.Day == 14 || args.Date.Day == 24 || args.Date.Day == 29)) {
35+
args.CellData.ClassList += " personal-appointment";
36+
}
37+
if (args.Date.Month == CurrentMonth && (args.Date.Day == 3 || args.Date.Day == 11 || args.Date.Day == 17 || args.Date.Day == 22))
38+
{
39+
args.CellData.ClassList += " official-appointment";
40+
}
3941
}
4042
}
4143
public void OnChange(ChangedEventArgs<DateTime?> args)
@@ -89,4 +91,6 @@ Customize specific dates in a [Blazor Calendar](https://www.syncfusion.com/blazo
8991
</style>
9092
9193
```
92-
{% previewsample "https://blazorplayground.syncfusion.com/embed/hXVAMBLBLyofGefV?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Calendar with special dates](./images/blazor_calendar_special_dates.png)" %}
94+
{% previewsample "https://blazorplayground.syncfusion.com/embed/hXVAMBLBLyofGefV?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Calendar with special dates](./images/blazor_calendar_special_dates.png)" %}
95+
96+
N> The `RenderDayCellEventArgs` includes a `CurrentView` property that identifies the active calendar view during rendering. Possible values are `Month`, `Year`, and `Decade`. Use this to apply view-specific logic and diagnostics within the `OnRenderDayCell` handler. This property is useful for customizing the rendering of day cells based on the calendar's current view.

blazor/datepicker/special-dates.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ You can customize specific dates in a DatePicker by using the [OnRenderDayCell](
2727
public DateTime? CurrentDate { get; set; } = DateTime.Now;
2828
public void CustomDates(RenderDayCellEventArgs args)
2929
{
30-
var CurrentMonth = CurrentDate.Value.Month;
31-
if (args.Date.Month == CurrentMonth && (args.Date.Day == 7 || args.Date.Day == 14 || args.Date.Day == 24 || args.Date.Day == 29)) {
32-
args.CellData.ClassList += " personal-appointment";
33-
}
34-
if (args.Date.Month == CurrentMonth && (args.Date.Day == 3 || args.Date.Day == 11 || args.Date.Day == 17 || args.Date.Day == 22))
35-
{
36-
args.CellData.ClassList += " official-appointment";
30+
if (args.CurrentView == "Month") {
31+
var CurrentMonth = CurrentDate.Value.Month;
32+
if (args.Date.Month == CurrentMonth && (args.Date.Day == 7 || args.Date.Day == 14 || args.Date.Day == 24 || args.Date.Day == 29)) {
33+
args.CellData.ClassList += " personal-appointment";
34+
}
35+
if (args.Date.Month == CurrentMonth && (args.Date.Day == 3 || args.Date.Day == 11 || args.Date.Day == 17 || args.Date.Day == 22))
36+
{
37+
args.CellData.ClassList += " official-appointment";
38+
}
3739
}
3840
}
3941
public void OnChange(ChangedEventArgs<DateTime?> args)
@@ -89,4 +91,6 @@ You can customize specific dates in a DatePicker by using the [OnRenderDayCell](
8991

9092

9193

92-
![Blazor DatePicker with special dates](./images/blazor_datepicker_special_dates.png)
94+
![Blazor DatePicker with special dates](./images/blazor_datepicker_special_dates.png)
95+
96+
N> The `RenderDayCellEventArgs` includes a `CurrentView` property that identifies the active calendar view during rendering. Possible values are `Month`, `Year`, and `Decade`. Use this to apply view-specific logic and diagnostics within the `OnRenderDayCell` handler. This property is useful for customizing the rendering of day cells based on the calendar's current view.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: post
3+
title: Disable Mouse Wheel in Blazor NumericTextBox | Syncfusion
4+
description: Learn how to enable or disable mouse wheel scrolling in the Syncfusion Blazor Numeric TextBox component using the AllowMouseWheel property.
5+
platform: Blazor
6+
control: Numeric TextBox
7+
documentation: ug
8+
---
9+
10+
# Prevent Mouse Wheel Value Change in Blazor NumericTextBox
11+
12+
The Blazor Numeric TextBox component supports controlling mouse wheel scrolling via the `AllowMouseWheel` property. This lets you prevent value changes when the input has focus and the user scrolls the mouse wheel.
13+
14+
## Enable/disable mouse wheel interaction
15+
16+
- Default: `AllowMouseWheel` is `true`, so the value increments/decrements based on the `Step` while scrolling the mouse wheel when the input is focused.
17+
- Disable: Set `AllowMouseWheel` to `false` to ignore mouse wheel scrolling. Other input methods (typing and spin buttons) continue to work.
18+
19+
```cshtml
20+
@using Syncfusion.Blazor.Inputs
21+
22+
<h4>Mouse wheel disabled</h4>
23+
<SfNumericTextBox TValue="double?" Value=10 Step=1 AllowMouseWheel="false" Placeholder="Enter a value"></SfNumericTextBox>
24+
```

blazor/query-builder/events.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
layout: post
3+
title: Events in Blazor Query Builder Component | Syncfusion
4+
description: Learn about the available events in the Syncfusion Blazor Query Builder, including the new Destroyed event that fires on component disposal.
5+
platform: Blazor
6+
control: Query Builder
7+
---
8+
9+
# Events in Blazor Query Builder Component
10+
11+
This section lists key events available in the Blazor Query Builder and when they are triggered during user interactions and lifecycle changes.
12+
13+
## Created
14+
15+
The Created event is triggered once the component has been initialized and is ready.
16+
17+
```cshtml
18+
<SfQueryBuilder TValue="Order" DataSource="@Data">
19+
<QueryBuilderEvents TValue="Order" Created="OnCreated"></QueryBuilderEvents>
20+
</SfQueryBuilder>
21+
22+
@code {
23+
public void OnCreated() {
24+
// Here, you can customize your code.
25+
}
26+
}
27+
```
28+
29+
## RuleChanged
30+
31+
The RuleChanged event is triggered whenever a rule or group is added, removed, or modified.
32+
33+
```cshtml
34+
<SfQueryBuilder TValue="Order" DataSource="@Data">
35+
<QueryBuilderEvents TValue="Order" RuleChanged="OnRuleChanged"></QueryBuilderEvents>
36+
</SfQueryBuilder>
37+
38+
@code {
39+
public void OnRuleChanged(RuleChangeEventArgs args)
40+
{
41+
// Here, you can customize your code.
42+
}
43+
}
44+
```
45+
## Changed
46+
47+
The Changed event is an EventCallback raised after a condition (And/Or), field, operator, or value change is applied in the Query Builder.
48+
49+
```cshtml
50+
<SfQueryBuilder TValue="Order" DataSource="@Data">
51+
<QueryBuilderEvents TValue="Order" Changed="OnChanged"></QueryBuilderEvents>
52+
</SfQueryBuilder>
53+
54+
@code {
55+
private void OnChanged(ChangeEventArgs args)
56+
{
57+
// Here, you can customize your code.
58+
}
59+
}
60+
```
61+
62+
## OnValueChange
63+
64+
Raised before a condition (And/Or), field, operator, or value is changed. Use this to validate or react before committing a change.
65+
66+
```cshtml
67+
<SfQueryBuilder TValue="Order" DataSource="@Data">
68+
<QueryBuilderEvents TValue="Order" OnValueChange="OnValueChange"></QueryBuilderEvents>
69+
</SfQueryBuilder>
70+
71+
@code {
72+
private void OnValueChange(ChangeEventArgs args)
73+
{
74+
// Here, you can customize your code.
75+
}
76+
}
77+
```
78+
79+
## DataBound
80+
81+
Triggered after the data source is populated and bound to the Query Builder.
82+
83+
```cshtml
84+
<SfQueryBuilder TValue="Order" DataSource="@Data">
85+
<QueryBuilderEvents TValue="Order" DataBound="OnDataBound"></QueryBuilderEvents>
86+
</SfQueryBuilder>
87+
88+
@code {
89+
private void OnDataBound(object args)
90+
{
91+
// Here, you can customize your code.
92+
}
93+
}
94+
```
95+
96+
## OnActionFailure
97+
98+
The OnActionFailure event is triggered whenever a remote data request or action fails in the QueryBuilder.
99+
100+
```cshtml
101+
<SfQueryBuilder TValue="Order" DataSource="@RemoteData">
102+
<QueryBuilderEvents TValue="Order" OnActionFailure="OnActionFailure"></QueryBuilderEvents>
103+
</SfQueryBuilder>
104+
105+
@code {
106+
private void OnActionFailure(Exception ex)
107+
{
108+
// Here, you can customize your code.
109+
}
110+
}
111+
```
112+
113+
## Drag-and-drop events
114+
115+
Enable drag-and-drop by setting the [`AllowDragAndDrop`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.QueryBuilder.SfQueryBuilder-1.html#Syncfusion_Blazor_QueryBuilder_SfQueryBuilder_1_AllowDragAndDrop) property to `true` (default is `false`).
116+
117+
### RuleDragStarting
118+
119+
This event is triggered **before** a rule or an entire group starts being dragged.The event arguments contain information about the dragged element.
120+
121+
```cshtml
122+
<SfQueryBuilder TValue="Order" DataSource="@Data" AllowDragAndDrop="true">
123+
<QueryBuilderEvents TValue="Order" RuleDragStarting="OnRuleDragStarting"></QueryBuilderEvents>
124+
</SfQueryBuilder>
125+
126+
@code {
127+
private void OnRuleDragStarting(RuleDragStartingEventArgs args)
128+
{
129+
// Here, you can customize your code.
130+
}
131+
}
132+
```
133+
134+
### RuleDropping
135+
136+
The RuleDropping event fires just before the dragged rule or group is dropped onto a target location. You can use this event to validate the drop target or modify the drop behavior dynamically.
137+
138+
```cshtml
139+
<SfQueryBuilder TValue="Order" DataSource="@Data" AllowDragAndDrop="true">
140+
<QueryBuilderEvents TValue="Order" RuleDropping="OnRuleDropping"></QueryBuilderEvents>
141+
</SfQueryBuilder>
142+
143+
@code {
144+
private void OnRuleDropping(RuleDroppingEventArgs args)
145+
{
146+
// Here, you can customize your code.
147+
}
148+
}
149+
```
150+
151+
### RuleDropped
152+
153+
This event is raised after a drag-and-drop operation has successfully completed and the query model has been updated.
154+
155+
```cshtml
156+
<SfQueryBuilder TValue="Order" DataSource="@Data" AllowDragAndDrop="true">
157+
<QueryBuilderEvents TValue="Order" RuleDropped="OnRuleDropped"></QueryBuilderEvents>
158+
</SfQueryBuilder>
159+
160+
@code {
161+
private void OnRuleDropped(RuleDroppedEventArgs args)
162+
{
163+
// Here, you can customize your code.
164+
}
165+
}
166+
```
167+
168+
## Destroyed
169+
170+
The Destroyed event is triggered when the component is disposed. Use it to perform reliable cleanup, detach external resources, or finalize logging.
171+
172+
```cshtml
173+
<SfQueryBuilder TValue="Order" DataSource="@Data">
174+
<QueryBuilderEvents TValue="Order" Destroyed="OnDestroyed"></QueryBuilderEvents>
175+
</SfQueryBuilder>
176+
177+
@code {
178+
public void OnDestroyed(object args)
179+
{
180+
// Here, you can customize your code.
181+
}
182+
}
183+
```

0 commit comments

Comments
 (0)