Add missing formatting features to RadzenSpreadsheet.
Add strikethrough, font family, font size, text wrap, merge cells UI,
cell borders, hyperlinks, number format colors, and conditional
formatting UI. Includes toolbar tools, undo/redo commands, XLSX
import/export, and 45 new tests.
2026-03-19 17:20:29 +02:00
|
|
|
@using Radzen.Blazor.Spreadsheet
|
2026-03-22 13:22:34 +02:00
|
|
|
@using Radzen.Documents.Spreadsheet
|
Add missing formatting features to RadzenSpreadsheet.
Add strikethrough, font family, font size, text wrap, merge cells UI,
cell borders, hyperlinks, number format colors, and conditional
formatting UI. Includes toolbar tools, undo/redo commands, XLSX
import/export, and 45 new tests.
2026-03-19 17:20:29 +02:00
|
|
|
@inject DialogService DialogService
|
|
|
|
|
|
|
|
|
|
<RadzenSplitButton Click=@OnClickAsync Icon="format_color_fill" Text="Conditional" Disabled=@IsDisabled ButtonStyle="ButtonStyle.Base" Size="ButtonSize.Small">
|
|
|
|
|
<ChildContent>
|
|
|
|
|
<RadzenSplitButtonItem Text="Greater Than..." Value="greater" />
|
|
|
|
|
<RadzenSplitButtonItem Text="Less Than..." Value="less" />
|
|
|
|
|
<RadzenSplitButtonItem Text="Between..." Value="between" />
|
|
|
|
|
<RadzenSplitButtonItem Text="Equal To..." Value="equal" />
|
|
|
|
|
<RadzenSplitButtonItem Text="Text Contains..." Value="text" />
|
|
|
|
|
</ChildContent>
|
|
|
|
|
</RadzenSplitButton>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
#nullable enable
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public Sheet? Sheet { get; set; }
|
|
|
|
|
|
|
|
|
|
private bool IsDisabled => Sheet?.Selection.Cell == CellRef.Invalid;
|
|
|
|
|
|
|
|
|
|
private async Task OnClickAsync(RadzenSplitButtonItem? item)
|
|
|
|
|
{
|
|
|
|
|
if (Sheet == null || Sheet.Selection.Cell == CellRef.Invalid)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ruleType = item?.Value ?? "greater";
|
|
|
|
|
|
|
|
|
|
var result = await DialogService.OpenAsync<ConditionalFormatDialog>("Conditional Formatting",
|
|
|
|
|
new Dictionary<string, object?>
|
|
|
|
|
{
|
|
|
|
|
{ "RuleType", ruleType }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (result is ConditionalFormatBase rule)
|
|
|
|
|
{
|
|
|
|
|
var command = new ConditionalFormatCommand(Sheet, Sheet.Selection.Range, rule);
|
|
|
|
|
Sheet.Commands.Execute(command);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|