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