Simple DataGridView : DataGridView « GUI Windows Forms « C# / CSharp Tutorial






using System;
using System.Drawing;
using System.Windows.Forms;

class MyClass : Form
{
    [STAThread]
    public static void Main()
    {
        Application.Run(new MyClass());
    }
    public MyClass()
    {
        Text = "Simple DataGridView";

        DataGridView grid = new DataGridView();
        grid.Parent = this;
        grid.AutoSize = true;
        grid.Dock = DockStyle.Fill;
        grid.ColumnCount = 3;
        grid.Columns[0].HeaderText = "First Name";
        grid.Columns[1].HeaderText = "Last Name";
        grid.Columns[2].HeaderText = "Email Address";
    }
}








23.83.DataGridView
23.83.1.Simple DataGridView
23.83.2.Programmatic Grid
23.83.3.Calculation with DataGridView
23.83.4.Custom Header Cells
23.83.5.Fill Columns
23.83.6.Virtual Data