Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (41 sloc) 2 KB
@page "/numeric"
@using NorthwindBlazor.Data
@using NorthwindBlazor.Models.Northwind
@using Microsoft.EntityFrameworkCore
<h1 style="display:inline">Numeric</h1><a style="margin-left: 10px" href="https://github.com/akorchev/blazor.radzen.com/blob/master/Pages/NumericPage.razor" target="_blank">[source code]</a><a style="margin-left: 10px" href="https://www.radzen.com/documentation/blazor/numeric/" target="_blank">[documentation]</a>
<p>This page demonstrates <b>Numeric</b> component.</p>
<RadzenCard>
<div class="row">
<div class="col-md-6">
<h3>Numeric</h3>
<RadzenNumeric TItem="int" Style="margin-bottom: 20px" Change="@(args => Change(args, "Numeric"))" />
<br />
<h3>Numeric with Min set to 1 and Max set to 10</h3>
<RadzenNumeric Min="1" Max="10" Value="1" TItem="int" Change="@(args => Change(args, "Numeric with Min set to 1 and Max set to 10"))" Style="margin-bottom: 20px" />
<br />
<h3>Numeric with placeholder and 0.5 step</h3>
<RadzenNumeric TItem="double" Placeholder="0.0" Step="0.5" Change="@(args => Change(args, "Numeric with placeholder and 0.5 step"))" Style="margin-bottom: 20px" />
<br />
<h3>Nullable numeric</h3>
<RadzenNumeric TItem="int?" Placeholder="Enter or clear value" Change="@(args => Change(args, "Nullable numeric"))" Style="margin-bottom: 20px" />
</div>
<div class="col-md-6">
<h3>Events</h3>
<RadzenCard style="overflow: auto;height:500px;">
@foreach (var e in events.OrderByDescending(i => i.Key))
{
@e.Value
<br />
}
</RadzenCard>
</div>
</div>
</RadzenCard>
@code {
Dictionary<DateTime, string> events = new Dictionary<DateTime, string>();
void Change(dynamic value, string name)
{
events.Add(DateTime.Now, $"{name} value changed to {value}");
StateHasChanged();
}
}
You can’t perform that action at this time.