DataGridView
Form
AutoSizeMode
Fill
Width
width
private void dataGridView1_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e) { dataGridView2.Columns[e.Column.Index].FillWeight = e.Column.FillWeight; }
private void dataGridView1_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e) { dataGridView2.Columns[e.Column.Index].Width = e.Column.Width; }
dataGridView1.AutoResizeColumns(); dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
foreach (DataGridViewColumn dcol in dataGridView1.Columns) { dcol.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; }
NotSet
None
Anchor
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)