{"id":31128875,"url":"https://github.com/anmcgrath/blazordatasheet","last_synced_at":"2026-02-20T04:01:00.603Z","repository":{"id":56762932,"uuid":"523992386","full_name":"anmcgrath/BlazorDatasheet","owner":"anmcgrath","description":"Simple excel-like datasheet Blazor component","archived":false,"fork":false,"pushed_at":"2025-11-15T09:35:28.000Z","size":275127,"stargazers_count":339,"open_issues_count":11,"forks_count":71,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-11-21T13:03:06.887Z","etag":null,"topics":["blazor","blazor-component","blazor-components","blazor-server","blazor-wasm","blazor-webassembly","csharp","datasheet","editor","excel","spreadsheet"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anmcgrath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"buy_me_a_coffee":"anmcgrath"}},"created_at":"2022-08-12T07:18:14.000Z","updated_at":"2025-11-17T21:25:31.000Z","dependencies_parsed_at":"2023-10-13T13:49:43.793Z","dependency_job_id":"ae15b957-0b07-4754-94ed-e156599843d2","html_url":"https://github.com/anmcgrath/BlazorDatasheet","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/anmcgrath/BlazorDatasheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmcgrath%2FBlazorDatasheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmcgrath%2FBlazorDatasheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmcgrath%2FBlazorDatasheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmcgrath%2FBlazorDatasheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anmcgrath","download_url":"https://codeload.github.com/anmcgrath/BlazorDatasheet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmcgrath%2FBlazorDatasheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29640861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T03:21:14.183Z","status":"ssl_error","status_checked_at":"2026-02-20T03:18:24.455Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blazor","blazor-component","blazor-components","blazor-server","blazor-wasm","blazor-webassembly","csharp","datasheet","editor","excel","spreadsheet"],"created_at":"2025-09-18T01:08:37.906Z","updated_at":"2026-02-20T04:01:00.580Z","avatar_url":"https://github.com/anmcgrath.png","language":"C#","funding_links":["https://buymeacoffee.com/anmcgrath"],"categories":[],"sub_categories":[],"readme":"# BlazorDatasheet\n\n[![NuGet Version](https://img.shields.io/nuget/v/BlazorDatasheet)](https://www.nuget.org/packages/BlazorDatasheet/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\nA simple datasheet component for editing tabular data.\n\n\u003cimg width=\"512\" alt=\"DatasheetScreenshot\" src=\"https://github.com/user-attachments/assets/b58fa2f3-f49d-4b20-9cbb-3ae1039d88bc\"\u003e\n\n#### Features\n- Data editing\n  - Built in editors including text, date, select, boolean, text area, enum\n  - Add custom editors for any data type\n- Conditional formatting\n- Data validation\n- Formula\n- Keyboard navigation\n- Copy and paste from tabulated data\n- Virtualization - handles many cells at once in both rows \u0026 cols.\n\nDemo: https://anmcgrath.github.io/BlazorDatasheet/\n\n### Getting Started\n\n#### Install the NuGet package\n\n```bash\ndotnet add package BlazorDatasheet\n```\n\n#### Configure Program.cs\n\nIn Program.cs, add the required services:\n\n```csharp\nbuilder.Services.AddBlazorDatasheet();\n```\n\n#### Import JS/CSS\n\nIn _Layout.cshtml or index.html add\n\n```htmlinblazor\n\u003clink href=\"_content/BlazorDatasheet/sheet-styles.css\" rel=\"stylesheet\"/\u003e\n```\n\nand\n\n```htmlinblazor\n\u003cscript src=\"_content/BlazorDatasheet/blazor-datasheet.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nBlazor Datasheet provides a **Datasheet** Blazor component that accepts a Sheet.\n\nA Sheet holds the data and configuration for a Datasheet. The data is set per Cell, or can be built using the ObjectEditorBuilder, which creates a datasheet based on a list of objects.\n\nThe following code displays an empty 3 x 3 data grid.\n\n```csharp\n\u003cDatasheet\n    Sheet=\"sheet\"/\u003e\n\n@code{\n\n    private Sheet sheet;\n\n    protected override void OnInitialized()\n    {\n        sheet = new Sheet(3, 3);\n    }\n\n}\n```\n\nThe default editor is the text editor, but can be changed by defining the Type property of each cell.\n\n### Setting \u0026 getting cell values\n\nCell values can be set in a few ways:\n\n```csharp\nsheet.Cells[0, 0].Value = \"Test\"\nsheet.Range(\"A1\").Value = \"Test\";\nsheet.Cells.SetValue(0, 0, \"Test\");\nsheet.Commands.ExecuteCommand(new SetCellValueCommand(0, 0, \"Test\"));\n```\n\nCell values are stored internally inside a ```CellValue``` wrapper. Values are converted implicitly when set above and a ```CellValueType``` is assigned to the cell.\n\nThe ```CellValueType``` is used for formula evaluation and can be one of the following:\n\n```\n    Empty = 0,\n    Error = 1,\n    Array = 2,\n    Unknown = 3,\n    Sequence = 4,\n    Reference = 5,\n    Number = 6,\n    Date = 7,\n    Text = 8,\n    Logical = 9,\n```\n\nThis conversion can be controlled, for example when setting the cell type to \"text\", values will always be stored as strings and no conversion will be made.\n\nThe conversion can additionally be modified by using the ```Sheet.Cells.BeforeCellValueConversion``` event. By changing the ```NewValue``` property of the argument, the value that is stored is modified.\n\n### Formula\n\nFormula can be applied to cells. When the cells or ranges that the formula cells reference change, the cell value is re-calculated.\n\n```csharp\nsheet.Cells[0, 0].Formula = \"=10+A2\"\n```\n\n### Formatting\n\nCell formats can be set in the following ways:\n\n```csharp\nsheet.Range(\"A1:A2\").Format = new CellFormat() { BackgroundColor = \"red\" };\nsheet.Commands.ExecuteCommand(\n    new SetFormatCommand(new RowRegion(10, 12), new CellFormat() { ForegroundColor = \"blue\" }));\nsheet.SetFormat(sheet.Range(new ColumnRegion(5)), new CellFormat() { FontWeight = \"bold\" });\nsheet.Cells[0, 0].Format = new CellFormat() { TextAlign = \"center\" };\n```\n\nWhen a cell format is set, it will be merged into any existing cell formats in the region that it is applied to. Any non-null format paremeters will be merged:\n\n```csharp\nsheet.Range(\"A1\").Format = new CellFormat() { BackgroundColor = \"red\" };\nsheet.Range(\"A1:A2\").Format = new CellFormat() { ForegroundColor = \"blue\" };\nvar format = sheet.Cells[0, 0].Format; // backroundColor = \"red\", foreground = \"blue\"\nvar format2 = sheet.Cells[1, 0].Format; // foreground = \"blue\"\n```\n\n### Cell types\nThe cell type specifies which renderer and editor are used for the cell. Cell types also help with explicit conversions when cell values are set.\n\n```csharp\nsheet.Range(\"A1:B5\").Type = \"boolean\"; // renders a checkbox\n```\n\nCustom editors and renderers can be defined. See the examples for more information.\n\n### Validation\nData validation can be set on cells/ranges. There are two modes of validation: strict and non-strict. When a validator is strict, the cell value will not be set by the editor if it fails validation.\n\nIf validation is not strict, the value can be set during editing but will show a validation error when rendered.\n\nAlthough a strict validation may be set on a cell, the value can be changed programmatically, but it will display as a validation error.\n\n```csharp\nsheet.Validators.Add(new ColumnRegion(0), new NumberValidator(isStrict: true));\n```\n\n### Regions and ranges\n\nA region is a geometric construct, for example:\n\n```csharp\nvar region = new Region(0, 5, 0, 5); // r0 to r5, c0 to c5\nvar cellRegion = new Region(0, 0); // cell A1\nvar colRegion = new ColumnRegion(0, 4); // col region spanning A to D\nvar rowRegion = new RowRegion(0, 3); // row region spanning 1 to 4\n```\n\nA range is a of region that also knows about the sheet. Ranges can be used to set certain parts of the sheet.\n\n```csharp\nvar range = sheet.Range(\"A1:C5\");\nvar range = sheet.Range(new ColumnRegion(0));\nvar range = sheet.Range(0, 0, 4, 5);\n```\n\n### Support\n* [Buy me a coffee](https://buymeacoffee.com/anmcgrath)\n\n### Community Links\n\n* [Using a Blazor Excel Datasheet To Update A Database](https://blazordata.net/ViewBlogPost/1)\n* [Using OpenAI to Update A Blazor Excel Worksheet](https://blazorhelpwebsite.com/ViewBlogPost/18069)\n* [Microsoft Fabric and the Blazor Data Sheet](https://blazordata.net/ViewBlogPost/4)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmcgrath%2Fblazordatasheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanmcgrath%2Fblazordatasheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmcgrath%2Fblazordatasheet/lists"}