Commit Graph

4 Commits

Author SHA1 Message Date
Atanas Korchev
609622692e 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:55 +03:00
Atanas Korchev
43647e292a Add localization service for RadzenSpreadsheet
Introduce a generic localization infrastructure that ships built-in English
defaults via .resx and allows user overrides through a public ILocalizer
interface. The service is designed to work across all Radzen components.

- Add ILocalizer interface for custom translation overrides
- Add internal Localizer class with fallback chain: custom → .resx → key
- Add RadzenStrings.resx with ~120 spreadsheet string keys
- Add UICulture/DefaultUICulture cascading parameter to RadzenComponent
- Add ISpreadsheet.Localize() for sub-component access
- Replace all hardcoded strings in spreadsheet tools, dialogs, and menus
- Register Localizer in AddRadzenComponents() with graceful fallback
- Works with zero configuration; user overrides are optional
2026-06-15 18:45:06 +03:00
Atanas Korchev
d99fdd3fcc Rename namespace to Radzen.Documents.Spreadsheet for document layer
137 document-layer files now use namespace Radzen.Documents.Spreadsheet.
26 UI-layer files keep Radzen.Blazor.Spreadsheet with using added.
Test files add using Radzen.Documents.Spreadsheet.
Sheet class renamed to Worksheet to match industry conventions.
2026-06-15 18:45:02 +03:00
Atanas Korchev
da52f2fe00 Add scientific format, accounting format, and Format Cells dialog.
- Scientific format engine: tokenize E+00/E-00 patterns, FormatScientific
  method with mantissa/exponent calculation, AdjustDecimals support
- Accounting format tokens: underscore (space), asterisk (fill skip),
  question mark (space-padded digit placeholder)
- New NumberFormatCategory values: Accounting and Scientific
- Category detection in GetCategory and presets in GetPresets
- numFmtId 44 mapping for accounting format
- Toolbar dropdown updated with Accounting and Scientific entries
- FormatCodeBuilder: static helper to build format codes from UI state
- FormatCellsDialog: category list, live preview, decimal/symbol/separator
  controls, date/time preset lists, custom format code input
- Format Cells button in Format tab with OnFormatCellsAsync handler
- 40 new tests: scientific/accounting format, presets, round-trip, dialog
2026-06-15 18:45:01 +03:00