77 references to DataGridViewAutoSizeColumnsMode
System.Windows.Forms (31)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (14)
314private DataGridViewAutoSizeColumnsMode _autoSizeColumnsMode; 442_autoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; 877[DefaultValue(DataGridViewAutoSizeColumnsMode.None)] 880public DataGridViewAutoSizeColumnsMode AutoSizeColumnsMode 887case DataGridViewAutoSizeColumnsMode.None: 888case DataGridViewAutoSizeColumnsMode.ColumnHeader: 889case DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader: 890case DataGridViewAutoSizeColumnsMode.AllCells: 891case DataGridViewAutoSizeColumnsMode.DisplayedCellsExceptHeader: 892case DataGridViewAutoSizeColumnsMode.DisplayedCells: 893case DataGridViewAutoSizeColumnsMode.Fill: 896throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(DataGridViewAutoSizeColumnsMode)); 906if (value == DataGridViewAutoSizeColumnsMode.ColumnHeader && !ColumnHeadersVisible) 912if (value == DataGridViewAutoSizeColumnsMode.Fill && dataGridViewColumn.Frozen)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (9)
1925AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); 1928public void AutoResizeColumns(DataGridViewAutoSizeColumnsMode autoSizeColumnsMode) 1933protected void AutoResizeColumns(DataGridViewAutoSizeColumnsMode autoSizeColumnsMode, bool fixedHeight) 10761&& AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.ColumnHeader))) 10770&& AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.Fill))) 10893&& AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.ColumnHeader))) 10902&& AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.Fill))) 15380&& AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.ColumnHeader))) 15389&& AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.Fill)))
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (8)
100(value == DataGridViewAutoSizeColumnMode.NotSet && DataGridView.AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.ColumnHeader))) 107(value == DataGridViewAutoSizeColumnMode.NotSet && DataGridView.AutoSizeColumnsMode == DataGridViewAutoSizeColumnsMode.Fill))) 871DataGridViewAutoSizeColumnsMode.AllCells => DataGridViewAutoSizeColumnMode.AllCells, 872DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader => DataGridViewAutoSizeColumnMode.AllCellsExceptHeader, 873DataGridViewAutoSizeColumnsMode.DisplayedCells => DataGridViewAutoSizeColumnMode.DisplayedCells, 874DataGridViewAutoSizeColumnsMode.DisplayedCellsExceptHeader => DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader, 875DataGridViewAutoSizeColumnsMode.ColumnHeader => DataGridViewAutoSizeColumnMode.ColumnHeader, 876DataGridViewAutoSizeColumnsMode.Fill => DataGridViewAutoSizeColumnMode.Fill,
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\DataGridViewDesigner.cs (2)
34public DataGridViewAutoSizeColumnsMode AutoSizeColumnsMode 698private bool ShouldSerializeAutoSizeColumnsMode() => Control.AutoSizeColumnsMode != DataGridViewAutoSizeColumnsMode.None;
System.Windows.Forms.Tests (44)
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (11)
143foreach (DataGridViewAutoSizeColumnsMode columnsAutoSizeMode in Enum.GetValues(typeof(DataGridViewAutoSizeColumnsMode))) 147bool canBeFrozen = autoSizeMode != DataGridViewAutoSizeColumnMode.Fill && !(columnsAutoSizeMode == DataGridViewAutoSizeColumnsMode.Fill && autoSizeMode == DataGridViewAutoSizeColumnMode.NotSet); 156if (autoSizeMode != DataGridViewAutoSizeColumnMode.ColumnHeader && !(columnsAutoSizeMode == DataGridViewAutoSizeColumnsMode.ColumnHeader && autoSizeMode == DataGridViewAutoSizeColumnMode.NotSet)) 174public void DataGridViewColumnCollection_Add_CustomAutoSizeMode_Success(bool columnHeadersVisible, bool visible, bool frozen, DataGridViewAutoSizeColumnsMode columnsAutoSizeMode, DataGridViewAutoSizeColumnMode autoSizeMode) 428[InlineData(DataGridViewAutoSizeColumnsMode.None, DataGridViewAutoSizeColumnMode.ColumnHeader)] 429[InlineData(DataGridViewAutoSizeColumnsMode.ColumnHeader, DataGridViewAutoSizeColumnMode.NotSet)] 430public void DataGridViewColumnCollection_Add_VisibleColumnHeadersNotVisibleInvalidAutoSize_ThrowsInvalidOperationException(DataGridViewAutoSizeColumnsMode autoSizeColumnsMode, DataGridViewAutoSizeColumnMode autoSizeMode) 446[InlineData(DataGridViewAutoSizeColumnsMode.None, DataGridViewAutoSizeColumnMode.Fill)] 447[InlineData(DataGridViewAutoSizeColumnsMode.Fill, DataGridViewAutoSizeColumnMode.NotSet)] 448public void DataGridViewColumnCollection_Add_VisibleFrozenColumnInvalidAutoSize_ThrowsInvalidOperationException(DataGridViewAutoSizeColumnsMode autoSizeColumnsMode, DataGridViewAutoSizeColumnMode autoSizeMode)
System\Windows\Forms\DataGridViewColumnTests.cs (30)
142foreach (DataGridViewAutoSizeColumnsMode dataGridMode in Enum.GetValues(typeof(DataGridViewAutoSizeColumnsMode))) 146if (dataGridMode == DataGridViewAutoSizeColumnsMode.ColumnHeader && !columnHeadersVisible) 153if (dataGridMode == DataGridViewAutoSizeColumnsMode.Fill && frozen) 168if (dataGridMode != DataGridViewAutoSizeColumnsMode.Fill) 179public void DataGridViewColumn_AutoSizeMode_SetWithDataGridView_GetReturnsExpected(DataGridViewAutoSizeColumnsMode parentMode, bool columnHeadersVisible, bool frozen, DataGridViewAutoSizeColumnMode value, DataGridViewAutoSizeColumnMode expectedInherited) 207foreach (DataGridViewAutoSizeColumnsMode dataGridMode in Enum.GetValues(typeof(DataGridViewAutoSizeColumnsMode))) 227public void DataGridViewColumn_AutoSizeMode_SetWithDataGridViewNotVisible_GetReturnsExpected(DataGridViewAutoSizeColumnsMode parentMode, bool columnHeadersVisible, bool frozen, DataGridViewAutoSizeColumnMode value, DataGridViewAutoSizeColumnMode expectedInherited) 297AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader, 350AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill 443AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill 1200yield return new object[] { true, DataGridViewAutoSizeColumnMode.Fill, true, DataGridViewAutoSizeColumnsMode.None, DataGridViewAutoSizeColumnsMode.None }; 1201yield return new object[] { true, DataGridViewAutoSizeColumnMode.Fill, false, DataGridViewAutoSizeColumnsMode.Fill, DataGridViewAutoSizeColumnsMode.None }; 1202yield return new object[] { false, DataGridViewAutoSizeColumnMode.Fill, true, DataGridViewAutoSizeColumnsMode.Fill, DataGridViewAutoSizeColumnsMode.Fill }; 1203yield return new object[] { false, DataGridViewAutoSizeColumnMode.Fill, false, DataGridViewAutoSizeColumnsMode.Fill, DataGridViewAutoSizeColumnsMode.Fill }; 1212AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader 1369[InlineData(DataGridViewAutoSizeColumnsMode.AllCells, DataGridViewAutoSizeColumnMode.AllCells)] 1370[InlineData(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader, DataGridViewAutoSizeColumnMode.AllCellsExceptHeader)] 1371[InlineData(DataGridViewAutoSizeColumnsMode.ColumnHeader, DataGridViewAutoSizeColumnMode.ColumnHeader)] 1372[InlineData(DataGridViewAutoSizeColumnsMode.DisplayedCells, DataGridViewAutoSizeColumnMode.DisplayedCells)] 1373[InlineData(DataGridViewAutoSizeColumnsMode.DisplayedCellsExceptHeader, DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader)] 1374[InlineData(DataGridViewAutoSizeColumnsMode.Fill, DataGridViewAutoSizeColumnMode.Fill)] 1375[InlineData(DataGridViewAutoSizeColumnsMode.None, DataGridViewAutoSizeColumnMode.None)] 1376public void DataGridViewColumn_InheritedAutoSizeMode_GetWithDataGridView_ReturnsExpected(DataGridViewAutoSizeColumnsMode mode, DataGridViewAutoSizeColumnMode expected) 1613AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader
System\Windows\Forms\DataGridViewTests.cs (2)
3564_dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; 3568_dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
System\Windows\Forms\DataGridViewTests.Rendering.cs (1)
166dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);