0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Visual Studio 2022 C# 表の使い方 dataGridView

Posted at

image.png

    ・dataGridView の基本的な設定
            // -start- DataGridView 基本設定 
            //行が自動的に作成されないようにする
            dataGridView1.AllowUserToAddRows = false;

            // 行ヘッダーを非表示にする これを入れないと一番左側に余計なマーク列が入ってしまう
            dataGridView1.RowHeadersVisible = false;

            //ヘッダーとすべてのセルの内容に合わせて、列の幅・行の高さを自動調整する これを入れないと横側に余白ができてしまう
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            // 全行削除
            //dataGridView1.Rows.Clear();
            //dataGridView1.Columns.Clear();

            // -end- DataGridView 基本設定 
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?