Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
@using System.Globalization
|
2026-03-25 11:03:06 +02:00
|
|
|
@using Radzen.Blazor
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
@using Radzen.Blazor.Spreadsheet
|
2026-03-22 13:22:34 +02:00
|
|
|
@using Radzen.Documents.Spreadsheet
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
@inherits SpreadsheetDialogBase
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Gap="0.5rem" Style="min-width: 400px">
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_ValidationType)) Component="validationType" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDropDown @bind-Value=@ValidationType Data=@ValidationTypes TextProperty="Name" ValueProperty="Value" Name="validationType" InputSize="InputSize.Small" Style="flex: 1" Change=@OnTypeChanged />
|
|
|
|
|
</RadzenStack>
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
|
2026-03-22 16:21:45 +02:00
|
|
|
@if (ValidationType != DataValidationType.List && ValidationType != DataValidationType.Custom)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Operator)) Component="operator" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDropDown @bind-Value=@Operator Data=@Operators TextProperty="Name" ValueProperty="Value" Name="operator" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
|
|
|
|
|
2026-03-22 16:21:45 +02:00
|
|
|
@if (ValidationType == DataValidationType.Custom)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Vertical" Gap="0.25rem">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Formula)) Component="formula" class="rz-text-subtitle2" Style="align-self: start" />
|
|
|
|
|
<RadzenTextBox @bind-Value=@Formula1 Name="formula" InputSize="InputSize.Small" Style="width: 100%" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
2026-03-22 16:21:45 +02:00
|
|
|
else if (ValidationType == DataValidationType.List)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Start">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_ValuesCommaSeparated)) Component="valuesList" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenTextArea @bind-Value=@Formula1 Name="valuesList" Rows="3" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
2026-03-22 16:21:45 +02:00
|
|
|
else if (Operator == DataValidationOperator.Between || Operator == DataValidationOperator.NotBetween)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
{
|
2026-03-22 16:21:45 +02:00
|
|
|
@if (ValidationType == DataValidationType.Date)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Minimum)) Component="minimum" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDatePicker @bind-Value=@Formula1Date DateFormat="yyyy-MM-dd" Name="minimum" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Maximum)) Component="maximum" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDatePicker @bind-Value=@Formula2Date DateFormat="yyyy-MM-dd" Name="maximum" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
2026-03-22 16:21:45 +02:00
|
|
|
else if (ValidationType == DataValidationType.Time)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Minimum)) Component="minimum" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDatePicker @bind-Value=@Formula1Date ShowTime="true" TimeOnly="true" Name="minimum" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Maximum)) Component="maximum" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDatePicker @bind-Value=@Formula2Date ShowTime="true" TimeOnly="true" Name="maximum" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Minimum)) Component="minimum" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenTextBox @bind-Value=@Formula1 Name="minimum" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Maximum)) Component="maximum" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenTextBox @bind-Value=@Formula2 Name="maximum" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2026-03-22 16:21:45 +02:00
|
|
|
@if (ValidationType == DataValidationType.Date)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Value)) Component="value" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDatePicker @bind-Value=@Formula1Date DateFormat="yyyy-MM-dd" Name="value" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
2026-03-22 16:21:45 +02:00
|
|
|
else if (ValidationType == DataValidationType.Time)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Value)) Component="value" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenDatePicker @bind-Value=@Formula1Date ShowTime="true" TimeOnly="true" Name="value" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Value)) Component="value" class="rz-text-subtitle2" Style="width: 8rem; text-align: end" />
|
|
|
|
|
<RadzenTextBox @bind-Value=@Formula1 Name="value" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
|
|
|
|
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0.5rem" Style="padding-inline-start: 8.5rem">
|
|
|
|
|
<RadzenCheckBox @bind-Value=@AllowBlank TValue="bool" Name="allowBlank" />
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_AllowBlank)) Component="allowBlank" class="rz-text-subtitle2" />
|
|
|
|
|
</RadzenStack>
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
|
2026-03-25 11:03:06 +02:00
|
|
|
<RadzenFieldset Text=@L(nameof(RadzenStrings.Spreadsheet_ErrorAlert))>
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
<RadzenStack Gap="0.5rem">
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Style)) Component="errorStyle" class="rz-text-subtitle2" Style="width: 7rem; text-align: end" />
|
|
|
|
|
<RadzenDropDown @bind-Value=@ErrorStyle Data=@ErrorStyles TextProperty="Name" ValueProperty="Value" Name="errorStyle" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Title)) Component="errorTitle" class="rz-text-subtitle2" Style="width: 7rem; text-align: end" />
|
|
|
|
|
<RadzenTextBox @bind-Value=@ErrorTitle Name="errorTitle" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Start">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Message)) Component="errorMessage" class="rz-text-subtitle2" Style="width: 7rem; text-align: end" />
|
|
|
|
|
<RadzenTextArea @bind-Value=@ErrorMessage Name="errorMessage" Rows="2" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
</RadzenStack>
|
|
|
|
|
</RadzenFieldset>
|
|
|
|
|
|
2026-03-25 11:03:06 +02:00
|
|
|
<RadzenFieldset Text=@L(nameof(RadzenStrings.Spreadsheet_InputPrompt))>
|
2026-03-19 20:48:46 +02:00
|
|
|
<RadzenStack Gap="0.5rem">
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0.5rem" Style="padding-inline-start: 7.5rem">
|
|
|
|
|
<RadzenCheckBox @bind-Value=@ShowInputMessage TValue="bool" Name="showInputMessage" />
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_ShowInputMessage)) Component="showInputMessage" class="rz-text-subtitle2" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Title)) Component="inputTitle" class="rz-text-subtitle2" Style="width: 7rem; text-align: end" />
|
|
|
|
|
<RadzenTextBox @bind-Value=@InputTitle Name="inputTitle" InputSize="InputSize.Small" Style="flex: 1" />
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Start">
|
|
|
|
|
<RadzenLabel Text=@L(nameof(RadzenStrings.Spreadsheet_Message)) Component="inputMessage" class="rz-text-subtitle2" Style="width: 7rem; text-align: end" />
|
|
|
|
|
<RadzenTextArea @bind-Value=@InputMessage Name="inputMessage" Rows="2" InputSize="InputSize.Small" Style="flex: 1" />
|
2026-03-19 20:48:46 +02:00
|
|
|
</RadzenStack>
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
</RadzenFieldset>
|
|
|
|
|
|
2026-06-05 09:47:52 +03:00
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" Gap="0.5rem" class="rz-spreadsheet-dialog-actions">
|
2026-05-18 11:48:29 +03:00
|
|
|
<RadzenButton Text=@L(nameof(RadzenStrings.Spreadsheet_Cancel)) Click=@OnCancel ButtonStyle="ButtonStyle.Base" Variant="Variant.Outlined" />
|
|
|
|
|
<RadzenButton Text=@L(nameof(RadzenStrings.Spreadsheet_OK)) Click=@OnOk ButtonStyle="ButtonStyle.Primary" Variant="Variant.Flat" />
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
</RadzenStack>
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
#nullable enable
|
2026-03-22 16:21:45 +02:00
|
|
|
private DataValidationType ValidationType { get; set; } = DataValidationType.WholeNumber;
|
|
|
|
|
private DataValidationOperator Operator { get; set; } = DataValidationOperator.Between;
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
private string Formula1 { get; set; } = "";
|
|
|
|
|
private string Formula2 { get; set; } = "";
|
|
|
|
|
private bool AllowBlank { get; set; } = true;
|
2026-03-22 16:21:45 +02:00
|
|
|
private DataValidationErrorStyle ErrorStyle { get; set; } = DataValidationErrorStyle.Stop;
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
private string ErrorTitle { get; set; } = "";
|
2026-03-25 11:03:06 +02:00
|
|
|
private string ErrorMessage { get; set; } = "";
|
2026-03-19 20:48:46 +02:00
|
|
|
private bool ShowInputMessage { get; set; }
|
2026-03-26 11:15:25 +02:00
|
|
|
private string InputTitle { get; set; } = "";
|
|
|
|
|
private string InputMessage { get; set; } = "";
|
2026-03-19 20:48:46 +02:00
|
|
|
private DateTime? Formula1Date { get; set; }
|
|
|
|
|
private DateTime? Formula2Date { get; set; }
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
|
2026-03-25 11:03:06 +02:00
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
|
|
|
|
ErrorMessage = L(nameof(RadzenStrings.Spreadsheet_DefaultValidationError));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<DropDownItem<DataValidationType>>? validationTypes;
|
|
|
|
|
private List<DropDownItem<DataValidationType>> ValidationTypes => validationTypes ??=
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
[
|
2026-03-25 11:03:06 +02:00
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationWholeNumber)), DataValidationType.WholeNumber),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationDecimal)), DataValidationType.Decimal),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationList)), DataValidationType.List),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationDate)), DataValidationType.Date),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationTime)), DataValidationType.Time),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationTextLength)), DataValidationType.TextLength),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ValidationCustom)), DataValidationType.Custom)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
];
|
|
|
|
|
|
2026-03-25 11:03:06 +02:00
|
|
|
private List<DropDownItem<DataValidationOperator>>? allOperators;
|
|
|
|
|
private List<DropDownItem<DataValidationOperator>> AllOperators => allOperators ??=
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
[
|
2026-03-25 11:03:06 +02:00
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorBetween)), DataValidationOperator.Between),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorNotBetween)), DataValidationOperator.NotBetween),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorEqualTo)), DataValidationOperator.Equal),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorNotEqualTo)), DataValidationOperator.NotEqual),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorGreaterThan)), DataValidationOperator.GreaterThan),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorLessThan)), DataValidationOperator.LessThan),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorGreaterThanOrEqual)), DataValidationOperator.GreaterThanOrEqual),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_OperatorLessThanOrEqual)), DataValidationOperator.LessThanOrEqual)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
];
|
|
|
|
|
|
2026-03-25 11:03:06 +02:00
|
|
|
private List<DropDownItem<DataValidationErrorStyle>>? errorStyles;
|
|
|
|
|
private List<DropDownItem<DataValidationErrorStyle>> ErrorStyles => errorStyles ??=
|
2026-03-19 20:48:46 +02:00
|
|
|
[
|
2026-03-25 11:03:06 +02:00
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ErrorStyleStop)), DataValidationErrorStyle.Stop),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ErrorStyleWarning)), DataValidationErrorStyle.Warning),
|
|
|
|
|
new(L(nameof(RadzenStrings.Spreadsheet_ErrorStyleInformation)), DataValidationErrorStyle.Information)
|
2026-03-19 20:48:46 +02:00
|
|
|
];
|
|
|
|
|
|
2026-03-22 16:21:45 +02:00
|
|
|
private List<DropDownItem<DataValidationOperator>> Operators => AllOperators;
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
|
|
|
|
|
private void OnTypeChanged()
|
|
|
|
|
{
|
2026-03-22 16:21:45 +02:00
|
|
|
if (ValidationType == DataValidationType.List)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
{
|
2026-03-22 16:21:45 +02:00
|
|
|
Operator = DataValidationOperator.Equal;
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnOk()
|
|
|
|
|
{
|
2026-03-19 20:48:46 +02:00
|
|
|
var formula1 = Formula1;
|
|
|
|
|
var formula2 = Formula2;
|
|
|
|
|
|
2026-03-22 16:21:45 +02:00
|
|
|
if (ValidationType == DataValidationType.Date)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
|
|
|
|
if (Formula1Date.HasValue)
|
|
|
|
|
{
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
formula1 = Formula1Date.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
|
|
|
|
if (Formula2Date.HasValue)
|
|
|
|
|
{
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
formula2 = Formula2Date.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-22 16:21:45 +02:00
|
|
|
else if (ValidationType == DataValidationType.Time)
|
2026-03-19 20:48:46 +02:00
|
|
|
{
|
|
|
|
|
if (Formula1Date.HasValue)
|
|
|
|
|
{
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
formula1 = (Formula1Date.Value.TimeOfDay.TotalDays).ToString(CultureInfo.InvariantCulture);
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
|
|
|
|
if (Formula2Date.HasValue)
|
|
|
|
|
{
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
formula2 = (Formula2Date.Value.TimeOfDay.TotalDays).ToString(CultureInfo.InvariantCulture);
|
2026-03-19 20:48:46 +02:00
|
|
|
}
|
|
|
|
|
}
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
else if (ValidationType is DataValidationType.WholeNumber or DataValidationType.Decimal or DataValidationType.TextLength)
|
|
|
|
|
{
|
|
|
|
|
// Bounds are typed in the workbook culture but stored as canonical invariant fragments.
|
|
|
|
|
formula1 = NormalizeNumericBound(formula1);
|
|
|
|
|
formula2 = NormalizeNumericBound(formula2);
|
|
|
|
|
}
|
|
|
|
|
else if (ValidationType == DataValidationType.Custom && formula1.StartsWith('='))
|
|
|
|
|
{
|
|
|
|
|
formula1 = FormulaLocalizer.ToInvariant(formula1, Culture);
|
|
|
|
|
}
|
2026-03-19 20:48:46 +02:00
|
|
|
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
var rule = new DataValidationRule
|
|
|
|
|
{
|
2026-03-22 16:21:45 +02:00
|
|
|
Type = ValidationType,
|
|
|
|
|
Operator = Operator,
|
2026-03-19 20:48:46 +02:00
|
|
|
Formula1 = formula1,
|
|
|
|
|
Formula2 = formula2,
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
AllowBlank = AllowBlank,
|
2026-03-22 16:21:45 +02:00
|
|
|
ErrorStyle = ErrorStyle,
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
ErrorTitle = string.IsNullOrEmpty(ErrorTitle) ? null : ErrorTitle,
|
2026-03-25 11:03:06 +02:00
|
|
|
Error = string.IsNullOrEmpty(ErrorMessage) ? L(nameof(RadzenStrings.Spreadsheet_DefaultValidationError)) : ErrorMessage,
|
2026-03-19 20:48:46 +02:00
|
|
|
ShowErrorMessage = true,
|
|
|
|
|
ShowInputMessage = ShowInputMessage,
|
2026-03-26 11:15:25 +02:00
|
|
|
InputTitle = string.IsNullOrEmpty(InputTitle) ? null : InputTitle,
|
|
|
|
|
InputMessage = string.IsNullOrEmpty(InputMessage) ? null : InputMessage
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DialogService.Close(rule);
|
|
|
|
|
}
|
|
|
|
|
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
private string NormalizeNumericBound(string value)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
{
|
Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.
Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:
- Cell input parsing (CellData type inference), including day-month date
handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
semantics: ';' argument separators and ',' decimals in comma-decimal
cultures, lenient comma acceptance where unambiguous, canonical invariant
storage)
- Dialog input (data validation, conditional format, filter) via shared
conversion helpers on SpreadsheetDialogBase
XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.
Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.
Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:40 +03:00
|
|
|
if (string.IsNullOrEmpty(value) || value.StartsWith('='))
|
|
|
|
|
{
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ToInvariantNumber(value);
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
|
|
|
|
|
2026-03-22 16:21:45 +02:00
|
|
|
private sealed class DropDownItem<T>(string name, T value)
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
{
|
|
|
|
|
public string Name { get; } = name;
|
2026-03-22 16:21:45 +02:00
|
|
|
public T Value { get; } = value;
|
Add data validation UI to RadzenSpreadsheet.
- Add DataValidationRule with support for WholeNumber, Decimal, List, Date,
Time, and TextLength validation types with all comparison operators
- Rename ICellVaidator to ICellValidator (fix typo)
- Extend ValidationStore with Remove, GetValidators, GetValidatorsForCell,
RemoveAll, and Ranges
- Add DataValidationCommand and ClearValidationCommand with undo/redo support
- Add Data Validation dialog and toolbar split button in Data tab
- Add red triangle error indicator (::after pseudo-element) and tooltip on
invalid cells
- Add list validation dropdown popup with chevron button
- Add XLSX import/export for dataValidation elements
- Add validation CSS to premium themes (material3, fluent)
- Add 40 tests covering validators, commands, undo/redo, and XLSX round-trips
2026-03-19 18:00:41 +02:00
|
|
|
}
|
|
|
|
|
}
|