{"id":30420768,"url":"https://github.com/skybrud/skybrud.umbraco.griddata","last_synced_at":"2025-08-22T08:20:11.831Z","repository":{"id":20890391,"uuid":"24177787","full_name":"skybrud/Skybrud.Umbraco.GridData","owner":"skybrud","description":"Strongly typed model for the grid in Umbraco.","archived":false,"fork":false,"pushed_at":"2024-09-28T14:07:47.000Z","size":3233,"stargazers_count":36,"open_issues_count":1,"forks_count":12,"subscribers_count":12,"default_branch":"v13/main","last_synced_at":"2025-07-22T10:28:58.561Z","etag":null,"topics":["csharp","dotnet","grid","limbo","package","skybrud","umbraco","umbraco-package","umbraco-packages","umbraco-v10","umbraco-v11","umbraco-v12","umbraco-v7","umbraco-v8","umbraco-v9"],"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/skybrud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2014-09-18T07:09:27.000Z","updated_at":"2024-11-04T08:08:37.000Z","dependencies_parsed_at":"2024-03-03T13:23:40.082Z","dependency_job_id":null,"html_url":"https://github.com/skybrud/Skybrud.Umbraco.GridData","commit_stats":{"total_commits":273,"total_committers":12,"mean_commits":22.75,"dds":0.08424908424908428,"last_synced_commit":"88e9a9671a5f6bd16270ff4bfd4d7ddf6326ef2f"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/skybrud/Skybrud.Umbraco.GridData","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skybrud%2FSkybrud.Umbraco.GridData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skybrud%2FSkybrud.Umbraco.GridData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skybrud%2FSkybrud.Umbraco.GridData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skybrud%2FSkybrud.Umbraco.GridData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skybrud","download_url":"https://codeload.github.com/skybrud/Skybrud.Umbraco.GridData/tar.gz/refs/heads/v13/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skybrud%2FSkybrud.Umbraco.GridData/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271606605,"owners_count":24788981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csharp","dotnet","grid","limbo","package","skybrud","umbraco","umbraco-package","umbraco-packages","umbraco-v10","umbraco-v11","umbraco-v12","umbraco-v7","umbraco-v8","umbraco-v9"],"created_at":"2025-08-22T08:20:06.845Z","updated_at":"2025-08-22T08:20:11.812Z","avatar_url":"https://github.com/skybrud.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Skybrud Grid Data\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/skybrud/Skybrud.Umbraco.GridData/blob/v13/main/LICENSE.md)\n[![NuGet](https://img.shields.io/nuget/vpre/Skybrud.Umbraco.GridData.svg)](https://www.nuget.org/packages/Skybrud.Umbraco.GridData)\n[![NuGet](https://img.shields.io/nuget/dt/Skybrud.Umbraco.GridData.svg)](https://www.nuget.org/packages/Skybrud.Umbraco.GridData)\n[![Umbraco Marketplace](https://img.shields.io/badge/umbraco-marketplace-%233544B1)](https://marketplace.umbraco.com/package/skybrud.umbraco.griddata)\n\n**Skybrud.Umbraco.GridData** is a package with a strongly typed model for the grid in Umbraco. The package makes it easy to work the grid in your MVC views, master pages or even in your custom logic - eg. to index the grid data in Examine for better searches.\n\nVersion 13 of this package specifically targets Umbraco 3, but past major versions also support older versions of Umbraco. For the Umbraco 10-12 package, see \u003ca href=\"https://github.com/skybrud/Skybrud.Umbraco.GridData/tree/v5/main\"\u003e\u003ccode\u003e\u003cstrong\u003ev4/main\u003c/strong\u003e\u003c/code\u003e\u003c/a\u003e branch. For the Umbraco 9 package, see \u003ca href=\"https://github.com/skybrud/Skybrud.Umbraco.GridData/tree/v4/main\"\u003e\u003ccode\u003e\u003cstrong\u003ev4/main\u003c/strong\u003e\u003c/code\u003e\u003c/a\u003e branch. For the Umbraco 8 package, see \u003ca href=\"https://github.com/skybrud/Skybrud.Umbraco.GridData/tree/v3/main\"\u003e\u003ccode\u003e\u003cstrong\u003ev3/main\u003c/strong\u003e\u003c/code\u003e\u003c/a\u003e branch.\n\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## Links\n\n- \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n- \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e\n- \u003ca href=\"#indexing-with-examine\"\u003eIndexing with Examine\u003c/a\u003e\n- \u003ca href=\"#rendering-the-grid\"\u003eRendering the grid\u003c/a\u003e\n- \u003ca href=\"#extending-the-grid\"\u003eExtending the grid\u003c/a\u003e\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## Installation\n\nThe Umbraco 13 version of this package is only available via \u003ca href=\"https://www.nuget.org/packages/Skybrud.Umbraco.GridData\" target=\"_blank\"\u003eNuGet\u003c/a\u003e. To install the package, you can use either .NET CLI:\n\n```\ndotnet add package Skybrud.Umbraco.GridData --version 13.0.0\n```\n\nor the older NuGet Package Manager:\n\n```\nInstall-Package Skybrud.Umbraco.GridData -Version 13.0.0\n```\n\n**Umbraco 10-12**  \nFor the Umbraco 9 version of this package, see the [**v5/main**](https://github.com/skybrud/Skybrud.Umbraco.GridData/tree/v5/main) branch instead.\n```\n\n**Umbraco 9**  \nFor the Umbraco 9 version of this package, see the [**v4/main**](https://github.com/skybrud/Skybrud.Umbraco.GridData/tree/v4/main) branch instead.\n\n**Umbraco 8**  \nFor the Umbraco 8 version of this package, see the [**v3/main**](https://github.com/skybrud/Skybrud.Umbraco.GridData/tree/v3/main) branch instead.\n\n\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## Add-ons\n\n- [**Skybrud.Umbraco.GridData.Dtge**](https://github.com/skybrud/Skybrud.Umbraco.GridData.Dtge)  \nAdds support for working with [**Doc Type Grid Editor**](https://github.com/skttl/umbraco-doc-type-grid-editor).\n\n\n\n\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## Examples\n\nThe package has its own property value converter, so you can simply get the grid model as:\n\n```C#\nGridDataModel grid = Model.Content.GetPropertyValue\u003cGridDataModel\u003e(\"content\");\n```\n\nIf you have the raw JSON string, you can parse it like:\n\n```C#\nGridDataModel grid = GridDataModel.Deserialize(json);\n```\n\nBut you can also just call an extension method to get the grid model:\n\n```C#\nGridDataModel grid = Model.Content.GetGridModel(\"content\");\n```\n\nThe benefit of the extension method is that it will always return an instance of `GridDataModel` - even if the property doesn't exists or doesn't have a value, so you don't have to check whether the returned value is `null`. However if you need it, you can use the `IsValid` property to validate that the model is valid (eg. not empty).\n\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## Indexing with Examine\n\nAs of `v2.0`, the `GridDataModel` contains a `GetSearchableText` method that will return a textual representation of the entire grid model - see the example below:\n\n```C#\n@using Skybrud.Umbraco.GridData\n@using Skybrud.Umbraco.GridData.Extensions\n@inherits UmbracoTemplatePage\n@{\n\n    GridDataModel grid = Model.Content.GetGridModel(\"content\");\n\n    \u003cpre\u003e@grid.GetSearchableText()\u003c/pre\u003e\n\n}\n```\n\nThe `GetSearchableText` method works by traversing all the controls of the grid, and calling a similar `GetSearchableText` method on each control. The end result will then be a string combined of the returned values from all the controls.\n\nThis of course requires that each control (or the model of it's value, really) can provide a textual representation of it's value.\n\nIf you need further control of the indexing, you can have a look at this example Gist:\n\n* [Gist: Indexing the Umbraco Grid.md](https://gist.github.com/abjerner/bdd89e0788d274ec5a33)\n\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## Rendering the grid\n\nThe package supports a number of different ways to render the grid. If we start out with the entire grid model, you can do something like (`Fanoe` is the framework/view that should be used for rendering the grid):\n\n```C#\n@using Skybrud.Umbraco.GridData\n@using Skybrud.Umbraco.GridData.Extensions\n@inherits UmbracoTemplatePage\n@{\n\n    GridDataModel grid = Model.Content.GetGridModel(\"content\");\n\n    @Html.GetTypedGridHtml(grid, \"Fanoe\")\n\n}\n```\n\nThis works by first getting the grid value, and then rendering the model into the current view. This can also be done in a single line instead (`Model.Content` as specified for the first parameter is an instance of `IPublishedContent`):\n\n```C#\n@using Skybrud.Umbraco.GridData.Extensions\n@inherits UmbracoTemplatePage\n\n@Html.GetTypedGridHtml(Model.Content, \"content\", \"Fanoe\")\n```\n\nSince both examples specifies the `Fanoe` view, the package will look for a partial view located at `~/Views/Partials/TypedGrid/Fanoe.cshtml` and with an instance of `GridDataModel` as the model. You can find an example of this partial view at the link below:\n\nhttps://github.com/abjerner/UmbracoGridDataDemo/blob/master/dev/web/Views/Partials/TypedGrid/Fanoe.cshtml\n\nYou can also have a look at an example partial view for rendering the individual rows of the grid:\n\nhttps://github.com/abjerner/UmbracoGridDataDemo/blob/master/dev/web/Views/Partials/TypedGrid/Rows/Default.cshtml\n\n\n\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## Extending the grid\n\nThe package will only provide models for the grid editors thats comes with Umbraco by default (as well as the editors from the Fanoe starter kit), but it is also possible to create your own models for custom controls.\n\nThis process might however be a bit complex, so I've written an article for [**Skrift.io**](http://skrift.io/) that describes this a bit further:\n\nhttp://skrift.io/articles/archive/strongly-typed-models-in-the-umbraco-grid/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskybrud%2Fskybrud.umbraco.griddata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskybrud%2Fskybrud.umbraco.griddata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskybrud%2Fskybrud.umbraco.griddata/lists"}