AutoDataGridViews 1.0.4

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

AutoDataGridViews

Description

AutoDataGridViews is a custom winform Control inherited from the class Systme.Windows.Forms.DataGridView

Example: This project is a C# library that provides [functionality].

Features

  • Strong code dependencies using Reflections and Attributes
  • Safe Code stype using type-based datagridview and table (instead of System.Data.DataTable)
  • Compatibility with relational database services such as MySQL.

Installation

Visit to https://github.com/Churnba/AutoDataGridViews

NuGet Installation

To install the package via NuGet, use the following command: PM> NuGet\Install-Package AutoDataGridViews -Version 1.0.4

Dependencies

This project has the following dependencies:

  • System.Windows

Usage

Once the project is installed, you can use it as follows:

Basic Usage

using AutoDataGridViews;
using MySql.Data.MySqlClient; // if needed

//Windows Form Designer generated code
private void InitializeComponent()
{
    var autoDataGridView1 = new AutoDataGridView();

    //...
    autoDataGridView1.Initialize(new AutoDataGridViewConfig()
    {
        ShowAddRowToolStrip = false,
        ShowDeleteRowToolStrip = false,
        SubscribeDefaultCellFormatting = false,
        SubscribeDefaultCellParsing = false,
    });


    _ = Task.Run(async ()=>
    {
        var table = await LoaderAsync(/*your strConn*/);
        table.AllApply();
        autoDataGridView1.Invoke(() =>
        {
            autoDataGridView1.ShowTable(table, IsBinding:true, readonlyPK:true);
        });
    });
}

class ExampleData : DataBase<ExampleData>
{
    [Primary]
    [AutoIncrement]
    public int Id { get; set; }

    public int? Age { get; set; }//NULLABLE

    [MaxSie(45)]
    public string name {get; set;} = string.Empty;//NOT NULL

    [MaxSie(15)]
    public string PhoneNumber {get;set;} = string.Empty;//NOT NULL

    [Generated]
    [MaxSie(45)]
    public string FirstName => name.Split(' ').Last();

    [MaxSie(45)]
    public string? EmailAddress {get; set;}//NULLABLE
}

public class ExampleDataCollection : TableBase<ExampleData>
{
    public override string Database => "DB_name";
    public readonly static string NAME = nameof(ExampleData);

    public ExampleDataCollection() : base(NAME)
    {
    }

    public ExampleDataCollection(int capacity) : base(NAME, capacity)
    {
    }

    public static async Task<ExampleDataCollection> LoaderAsync(string connStr)
    {
        using MySqlConnection conn = new MySqlConnection(connStr);
        await conn.OpenAsync();
        ExampleDataCollection table = new ExampleDataCollection();
        var builder = table.SelectBuilder ?? new(table);

        using MySqlCommand cmd = new(builder.SelectAll(), conn);

        using var reader = await cmd.ExecuteReaderAsync();

        while (await reader.ReadAsync())
        {
            
            //ITable.TryAdd is slow. (about 30ms per a single row)
            //You need to override this method if you want to run fast.
            table.TryAdd(reader);
        }
        return table;
    }
}

Release Notes

[1.0.4] - 2026-04-15

✨ Added

  • Added TableGenerator static class based on ILGenerator
  • Added ColumnOrderAttribute class
  • Added OffsetAttribute class

🔧 Changed

  • Changed access modifier of ColumnInfo.Format to public

[1.0.3] - 2026-04-10

✨ Added

  • Added ITable.Add(IData data) method

🔧 Changed

  • Moved part of AutoDataGridView.ShowTable logic to AddColumns()
  • Renamed class name of CustomFormatProvider to AutoFormatProvider

[1.0.0]

Initial release of AutoDataGridView

Product Compatible and additional computed target framework versions.
.NET net7.0-windows7.0 is compatible.  net8.0-windows was computed.  net9.0-windows 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.
  • net7.0-windows7.0

    • No dependencies.

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.0.4 121 4/15/2026
1.0.3 109 4/10/2026
1.0.2 129 12/29/2025
1.0.1 314 9/19/2025
1.0.0 212 5/19/2025