Consolonia.Controls.DataGrid 12.1.4.15

dotnet add package Consolonia.Controls.DataGrid --version 12.1.4.15
                    
NuGet\Install-Package Consolonia.Controls.DataGrid -Version 12.1.4.15
                    
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="Consolonia.Controls.DataGrid" Version="12.1.4.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Consolonia.Controls.DataGrid" Version="12.1.4.15" />
                    
Directory.Packages.props
<PackageReference Include="Consolonia.Controls.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 Consolonia.Controls.DataGrid --version 12.1.4.15
                    
#r "nuget: Consolonia.Controls.DataGrid, 12.1.4.15"
                    
#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 Consolonia.Controls.DataGrid@12.1.4.15
                    
#: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=Consolonia.Controls.DataGrid&version=12.1.4.15
                    
Install as a Cake Addin
#tool nuget:?package=Consolonia.Controls.DataGrid&version=12.1.4.15
                    
Install as a Cake Tool

logo

Consolonia.Controls.DataGrid

DataGrid templates, styles, and helpers for Consolonia with multi‑theme support (Avalonia 12). Extracted from Consolonia.Themes into a standalone, reusable package.

What’s inside

  • Base templates for DataGrid, DataGridRow, DataGridCell, DataGridColumnHeader, headers presenter, scrollbars, grid lines, and separators.
  • Theme resources tuned for text‑mode rendering (1×1 glyph cells, single‑char rules, minimal borders).
  • Modern theme override that disables caret rendering inside rows to avoid visual noise during navigation.
  • Attached property DataGridExtensions.IsSelected used by the row template to project selection state into the caret/control visuals.
  • XAML namespace mapping for https://github.com/consolonia so all helpers are usable with the standard Consolonia XMLNS.

Installation

Install from NuGet:

dotnet add package Consolonia.Controls.DataGrid

or via Package Manager:

Install-Package Consolonia.Controls.DataGrid

Target framework: net8.0 Requires: Avalonia version 12.0.3, Avalonia.Controls.DataGrid version 12.0.0, Consolonia.Core, Consolonia.Controls.

How to use

There are two common ways to consume the templates.

  1. Recommended: via Consolonia themes (no extra setup)
  • If your app already uses Consolonia.Themes (e.g., ModernTheme, TurboVision*), the DataGrid templates are merged automatically. No additional XAML is required.
  1. Direct include (standalone)
  • Add the resource dictionary directly in your application or theme resources:
<Styles xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Styles.Resources>
    <ResourceInclude Source="avares://Consolonia.Controls.DataGrid/Themes/Templates/Controls/DataGrid.axaml" />
  </Styles.Resources>
</Styles>
  • Optional Modern override (turns off the in‑row caret):
<StyleInclude Source="avares://Consolonia.Controls.DataGrid/Themes/Modern/Controls/DataGridRow.axaml" />

XAML namespace (for helpers/attached props):

xmlns:console="https://github.com/consolonia"

Example

<DataGrid AutoGenerateColumns="False"
          ItemsSource="{Binding People}"
          HeadersVisibility="Column"
          CanUserSortColumns="True">
  <DataGrid.Columns>
    <DataGridTextColumn Header="Name"  Binding="{Binding Name}" />
    <DataGridTextColumn Header="Age"   Binding="{Binding Age}" />
    <DataGridTextColumn Header="City"  Binding="{Binding City}" />
  </DataGrid.Columns>
</DataGrid>

Theme notes

  • Base templates ship in Themes/Templates/Controls/DataGrid.axaml and work across Consolonia themes.
  • Modern theme customization lives in Themes/Modern/Controls/DataGridRow.axaml and can be included on top of base templates.
  • If you use Consolonia.Themes, these are already wired:
    • AllControls.axaml merges the base DataGrid templates from this assembly.
    • ModernBase.axaml includes the Modern DataGridRow override from this assembly.

API surface

  • Consolonia.Controls.DataGrid.Helpers.DataGridExtensions:
    • IsSelected (attached, bool) — set by styles to signal row selection for caret/visual logic.

Compatibility

  • Avalonia: 12.0.x (pinned in repo to 12.0.3).
  • Consolonia: same minor as this package (see Directory.Build.props VersionPrefix).
  • Runtime: net8.0.

Building from source

git clone https://github.com/consolonia/consolonia
cd Consolonia/src
dotnet build

Contributing

Issues and PRs are welcome. Please see the root repository contributing.md for guidelines.

License

MIT © Consolonia contributors

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (2)

Showing the top 2 NuGet packages that depend on Consolonia.Controls.DataGrid:

Package Downloads
Bashka.Helpers

Package Description

Bashka.Launcher

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
12.1.4.15 195 11/3/2026
12.1.4.15-alpha.2999 48 11/8/2026
12.1.4.15-alpha.2998 49 11/8/2026
12.1.4.15-alpha.2997 52 11/8/2026
12.1.4.15-alpha.2981 53 11/7/2026
12.1.4.15-alpha.2976 47 11/7/2026
12.1.4.14-alpha.2938 56 11/3/2026
12.1.4.14-alpha.2925 68 11/2/2026
12.1.4.14-alpha.2924 64 11/2/2026
12.1.4.14-alpha.2922 62 11/1/2026
12.1.4.14-alpha.2913 66 10/23/2026
12.1.4.14-alpha.2912 61 10/23/2026
12.1.4.14-alpha.2911 62 10/23/2026
12.1.4.14-alpha.2910 59 10/23/2026
12.1.4.14-alpha.2908 67 10/20/2026
12.0.3.14-alpha.2904 63 10/20/2026
12.0.3.14-alpha.2902 62 10/15/2026
12.0.3.14-alpha.2900 59 10/15/2026
12.0.3.14-alpha.2898 62 10/14/2026
12.0.3.14-alpha.2897 69 10/14/2026
Loading failed