Soenneker.DataTables.Attributes.Column
4.0.36
Prefix Reserved
dotnet add package Soenneker.DataTables.Attributes.Column --version 4.0.36
NuGet\Install-Package Soenneker.DataTables.Attributes.Column -Version 4.0.36
<PackageReference Include="Soenneker.DataTables.Attributes.Column" Version="4.0.36" />
<PackageVersion Include="Soenneker.DataTables.Attributes.Column" Version="4.0.36" />
<PackageReference Include="Soenneker.DataTables.Attributes.Column" />
paket add Soenneker.DataTables.Attributes.Column --version 4.0.36
#r "nuget: Soenneker.DataTables.Attributes.Column, 4.0.36"
#:package Soenneker.DataTables.Attributes.Column@4.0.36
#addin nuget:?package=Soenneker.DataTables.Attributes.Column&version=4.0.36
#tool nuget:?package=Soenneker.DataTables.Attributes.Column&version=4.0.36
Soenneker.DataTables.Attributes.Column
DataTableColumnAttribute attaches DataTables column metadata to properties so a table-building layer can discover it through reflection.
Installation
dotnet add package Soenneker.DataTables.Attributes.Column
Usage
using Soenneker.DataTables.Attributes.Column;
public sealed class CustomerRow
{
[DataTableColumn(
Title = "Customer",
Data = "name",
Name = "name",
Searchable = true,
Orderable = true,
ResponsivePriority = 1,
Order = 0)]
public required string Name { get; init; }
[DataTableColumn(
Title = "Email",
Data = "contact.email",
DefaultContent = "—",
ClassName = "text-nowrap",
Width = "18rem",
Order = 1)]
public string? Email { get; init; }
[DataTableColumn(Visible = false, Order = 2)]
public Guid Id { get; init; }
}
Read the metadata from a property with normal reflection:
using System.Reflection;
PropertyInfo property = typeof(CustomerRow).GetProperty(nameof(CustomerRow.Name))!;
DataTableColumnAttribute? column = property.GetCustomAttribute<DataTableColumnAttribute>();
The package stores configuration only. Your application or a companion table builder must translate the attribute into the JavaScript DataTables column definition.
Defaults and conventions
Visibledefaults totrue.SearchableandOrderabledefault tofalse; opt in explicitly.OrderandResponsivePrioritydefault to-1, which is useful as an “unspecified” sentinel in the consuming mapper.DataandOrderDataareobjectbecause DataTables accepts more than one value shape. Attribute arguments are restricted by the CLR, so use strings, numeric values, or arrays that your mapper understands.- Property names and nested data paths are not validated by this package.
| Product | Versions 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.DataTables.Attributes.Column:
| Package | Downloads |
|---|---|
|
Soenneker.DataTables.Extensions.Types
A collection of helpful Type extension methods relating to DataTable.js |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.36 | 224 | 10/14/2026 |
| 4.0.35 | 123 | 10/14/2026 |
| 4.0.34 | 89 | 10/14/2026 |
| 4.0.33 | 107 | 10/13/2026 |
| 4.0.30 | 109 | 10/12/2026 |
| 4.0.29 | 101 | 10/12/2026 |
| 4.0.28 | 141 | 10/11/2026 |
| 4.0.27 | 273 | 9/24/2026 |
| 4.0.26 | 236 | 9/15/2026 |
| 4.0.25 | 187 | 9/12/2026 |
| 4.0.24 | 278 | 8/30/2026 |
| 4.0.23 | 120 | 8/29/2026 |
| 4.0.22 | 546 | 7/27/2026 |
| 4.0.21 | 370 | 7/16/2026 |
| 4.0.20 | 583 | 6/18/2026 |
| 4.0.19 | 473 | 6/5/2026 |
| 4.0.18 | 498 | 4/22/2026 |
| 4.0.17 | 230 | 3/12/2026 |
| 4.0.16 | 138 | 3/12/2026 |
| 4.0.15 | 138 | 3/12/2026 |
Update dependency dotnet-sdk to v10.0.402 (#306)
Automatically merged