Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

68 lines (61 sloc) 2.76 KB
@page "/splitbutton"
@using NorthwindBlazor.Data
@using NorthwindBlazor.Models.Northwind
@using Microsoft.EntityFrameworkCore
<h1 style="display:inline">SplitButton</h1><a style="margin-left: 10px" href="https://github.com/akorchev/blazor.radzen.com/blob/master/Pages/SplitButtonPage.razor" target="_blank">[source code]</a><a style="margin-left: 10px" href="https://www.radzen.com/documentation/blazor/splitbutton/" target="_blank">[documentation]</a>
<p>This page demonstrates <b>SplitButton</b> component.</p>
<RadzenCard>
<div class="row">
<div class="col-md-6">
<h3>SplitButton with text</h3>
<RadzenSplitButton Click="@((args) => Click(args, "SplitButton with text"))" Text="SplitButton" Style="margin-bottom: 20px;">
<ChildContent>
<RadzenSplitButtonItem Text="Item1" Value="1" />
<RadzenSplitButtonItem Text="Item2" Value="2" />
</ChildContent>
</RadzenSplitButton>
<br />
<h3>SplitButton with text and icon</h3>
<RadzenSplitButton Click="@((args) => Click(args, "SplitButton with text and icon"))" Text="SplitButton" Icon="account_circle" Style="margin-bottom: 20px;">
<ChildContent>
<RadzenSplitButtonItem Text="Item1" Value="1" Icon="account_box" />
<RadzenSplitButtonItem Text="Item2" Value="2" Icon="account_balance_wallet" />
</ChildContent>
</RadzenSplitButton>
<br />
<h3>SplitButton with icon</h3>
<RadzenSplitButton Click="@((args) => Click(args, "SplitButton with icon"))" Icon="account_circle" Style="margin-bottom: 20px;">
<ChildContent>
<RadzenSplitButtonItem Text="Item1" Value="1" Icon="account_box" />
<RadzenSplitButtonItem Text="Item2" Value="2" Icon="account_balance_wallet" />
</ChildContent>
</RadzenSplitButton>
<br />
</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 Click(RadzenSplitButtonItem item, string buttonName)
{
if(item != null)
{
events.Add(DateTime.Now, $"{buttonName}, item with value {item.Value} clicked");
}
else
{
events.Add(DateTime.Now, $"{buttonName} clicked");
}
StateHasChanged();
}
}
You can’t perform that action at this time.