forked from syncfusion/blazor-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRangeValidation.razor
More file actions
124 lines (102 loc) · 3.41 KB
/
RangeValidation.razor
File metadata and controls
124 lines (102 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
@page "/NumericTextBox/RangeValidation"
@using Syncfusion.EJ2.Blazor.Inputs
@using Syncfusion.EJ2.Blazor.Buttons
@inherits SampleBaseComponent;
<div class="control-section col-lg-12 range">
<div class="col-lg-8">
<div class='content rangevalidation'>
<div class="control-label">
Numeric TextBox
</div>
<EjsNumericTextBox TValue="int?" Min="@setMin" Max="@setMax" Value=15 Step=@setIncrement></EjsNumericTextBox>
</div>
</div>
<div class="col-lg-4">
<div class='content property-section'>
<div class="property">Properties</div>
<table>
<tbody>
<tr>
<td>
<div class="selectionText">Min Value </div>
</td>
<td>
<div>
<EjsNumericTextBox @ref="MinObj" TValue="int?" Format="n0" @bind-Value="@minValue"></EjsNumericTextBox>
</div>
</td>
</tr>
<tr>
<td>
<div class="selectionText">Max Value </div>
</td>
<td>
<div>
<EjsNumericTextBox @ref="MaxObj" TValue="int?" Width="100%" Format="n0" @bind-Value="@maxValue"></EjsNumericTextBox>
</div>
</td>
</tr>
<tr>
<td>
<div class="selectionText">Increment step </div>
</td>
<td>
<div>
<EjsNumericTextBox @ref="StepObj" TValue="int?" Width="100%" Format="n0" @bind-Value="@stepValue"></EjsNumericTextBox>
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<button class="e-btn apply-limit" @onclick="@ApplyRange">Apply</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@code{
public EjsNumericTextBox<int?> MinObj;
public EjsNumericTextBox<int?> MaxObj;
public EjsNumericTextBox<int?> StepObj;
private int setMin { get; set; } = 10;
private int setMax { get; set; } = 100;
private int setIncrement { get; set; } = 1;
private int? minValue = 10 ;
private int? maxValue = 100;
private int? stepValue = 1;
public void ApplyRange(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
setMin = (int)this.MinObj.Value;
setMax = (int)this.MaxObj.Value;
setIncrement = (int)this.StepObj.Value;
}
}
<style>
.control-section.range {
margin-top: 20px;
}
.rangevalidation {
width: 55%;
margin-left: 80px;
}
.selectionText {
margin: 10px;
width: 100px;
}
.apply-limit {
margin-top: 10px;
}
.control-label {
padding: 24px 0px 10px 0px;
font-size: 12px;
}
.property {
padding-left: 10px;
padding-bottom: 20px;
font-weight: 600;
font-size: 15px;
}
</style>