Modgift.Umbraco.DataGrid 1.1.8

dotnet add package Modgift.Umbraco.DataGrid --version 1.1.8
                    
NuGet\Install-Package Modgift.Umbraco.DataGrid -Version 1.1.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Modgift.Umbraco.DataGrid" Version="1.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Modgift.Umbraco.DataGrid" Version="1.1.8" />
                    
Directory.Packages.props
<PackageReference Include="Modgift.Umbraco.DataGrid" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Modgift.Umbraco.DataGrid --version 1.1.8
                    
#r "nuget: Modgift.Umbraco.DataGrid, 1.1.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Modgift.Umbraco.DataGrid@1.1.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Modgift.Umbraco.DataGrid&version=1.1.8
                    
Install as a Cake Addin
#tool nuget:?package=Modgift.Umbraco.DataGrid&version=1.1.8
                    
Install as a Cake Tool

Modgift.Umbraco.DataGrid

A multiple column data editor property editor for Umbraco with a strongly-typed DataGrid model.

Rendering

Add the namespace to your view:

@using Modgift.Umbraco.DataGrid.Models;

Get the DataGrid value from your model:

@{
    DataGrid? dataGrid = Model.Datagrid;
}

Using RenderGrid()

The simplest way to render the grid is with the built-in RenderGrid() method:

@dataGrid?.RenderGrid()

This outputs the following HTML structure:

<div class="data-grid">
    <div class="row">
        <div class="cell">
            <span class="value">Value</span>
            <span class="unit">Unit</span>
        </div>
        <div class="cell">
            <span class="value">Value</span>
            <span class="unit">Unit</span>
        </div>
    </div>
</div>

To render without units, pass false:

@dataGrid?.RenderGrid(includeUnits: false)
Parameter Type Default Description
includeUnits bool true Whether to include the unit after each value

Manual rendering

For full control over the markup, iterate the model directly:

@if (dataGrid?.Rows.Any() == true)
{
    <table>
        @foreach (DataGridRow row in dataGrid.Rows)
        {
            <tr>
                @foreach (DataGridCell cell in row.Cells)
                {
                    <td>@cell.Value (@cell.Unit)</td>
                }
            </tr>
        }
    </table>
}

Model reference

Class Property Type Description
DataGrid Rows List<DataGridRow> The rows in the grid
DataGridRow Cells List<DataGridCell> The cells in a row
DataGridCell Value string The cell value
DataGridCell Unit string The cell unit
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.8 140 3/20/2026