1 write to _dataGridView
System.Windows.Forms.Tests (1)
System\Windows\Forms\DataGridViewTests.cs (1)
22
_dataGridView
= new();
269 references to _dataGridView
System.Windows.Forms.Tests (269)
System\Windows\Forms\DataGridViewTests.cs (269)
25
public void Dispose() =>
_dataGridView
.Dispose();
2941
sender.Should().Be(
_dataGridView
);
2946
_dataGridView
.AllowUserToAddRowsChanged += handler;
2947
_dataGridView
.AllowUserToAddRows = !
_dataGridView
.AllowUserToAddRows;
2950
_dataGridView
.AllowUserToAddRowsChanged -= handler;
2951
_dataGridView
.AllowUserToAddRows = !
_dataGridView
.AllowUserToAddRows;
2961
sender.Should().Be(
_dataGridView
);
2966
_dataGridView
.AllowUserToDeleteRowsChanged += handler;
2967
_dataGridView
.AllowUserToDeleteRows = !
_dataGridView
.AllowUserToDeleteRows;
2970
_dataGridView
.AllowUserToDeleteRowsChanged -= handler;
2971
_dataGridView
.AllowUserToDeleteRows = !
_dataGridView
.AllowUserToDeleteRows;
2981
sender.Should().Be(
_dataGridView
);
2986
_dataGridView
.AllowUserToOrderColumnsChanged += handler;
2987
_dataGridView
.AllowUserToOrderColumns = !
_dataGridView
.AllowUserToOrderColumns;
2990
_dataGridView
.AllowUserToOrderColumnsChanged -= handler;
2991
_dataGridView
.AllowUserToOrderColumns = !
_dataGridView
.AllowUserToOrderColumns;
3001
sender.Should().Be(
_dataGridView
);
3006
_dataGridView
.AllowUserToResizeColumnsChanged += handler;
3007
_dataGridView
.AllowUserToResizeColumns = !
_dataGridView
.AllowUserToResizeColumns;
3010
_dataGridView
.AllowUserToResizeColumnsChanged -= handler;
3011
_dataGridView
.AllowUserToResizeColumns = !
_dataGridView
.AllowUserToResizeColumns;
3021
sender.Should().Be(
_dataGridView
);
3026
_dataGridView
.AllowUserToResizeRowsChanged += handler;
3027
_dataGridView
.AllowUserToResizeRows = !
_dataGridView
.AllowUserToResizeRows;
3030
_dataGridView
.AllowUserToResizeRowsChanged -= handler;
3031
_dataGridView
.AllowUserToResizeRows = !
_dataGridView
.AllowUserToResizeRows;
3041
sender.Should().Be(
_dataGridView
);
3046
_dataGridView
.AlternatingRowsDefaultCellStyleChanged += handler;
3047
_dataGridView
.AlternatingRowsDefaultCellStyle = new() { BackColor = Color.AliceBlue };
3050
_dataGridView
.AlternatingRowsDefaultCellStyleChanged -= handler;
3051
_dataGridView
.AlternatingRowsDefaultCellStyle = new();
3061
sender.Should().Be(
_dataGridView
);
3066
_dataGridView
.AutoGenerateColumnsChanged += handler;
3067
_dataGridView
.AutoGenerateColumns = !
_dataGridView
.AutoGenerateColumns;
3070
_dataGridView
.AutoGenerateColumnsChanged -= handler;
3071
_dataGridView
.AutoGenerateColumns = !
_dataGridView
.AutoGenerateColumns;
3081
sender.Should().Be(
_dataGridView
);
3086
_dataGridView
.BackgroundColorChanged += handler;
3087
_dataGridView
.BackgroundColor = Color.AliceBlue;
3090
_dataGridView
.BackgroundColorChanged -= handler;
3091
_dataGridView
.BackgroundColor = Color.Azure;
3101
sender.Should().Be(
_dataGridView
);
3106
_dataGridView
.BorderStyleChanged += handler;
3107
_dataGridView
.BorderStyle = BorderStyle.Fixed3D;
3110
_dataGridView
.BorderStyleChanged -= handler;
3111
_dataGridView
.BorderStyle = BorderStyle.FixedSingle;
3121
sender.Should().Be(
_dataGridView
);
3126
_dataGridView
.CellBorderStyleChanged += handler;
3127
_dataGridView
.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
3130
_dataGridView
.CellBorderStyleChanged -= handler;
3131
_dataGridView
.CellBorderStyle = DataGridViewCellBorderStyle.Single;
3141
sender.Should().Be(
_dataGridView
);
3146
_dataGridView
.ColumnHeadersBorderStyleChanged += handler;
3147
_dataGridView
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
3150
_dataGridView
.ColumnHeadersBorderStyleChanged -= handler;
3151
_dataGridView
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised;
3161
sender.Should().Be(
_dataGridView
);
3166
_dataGridView
.ColumnHeadersDefaultCellStyleChanged += handler;
3167
_dataGridView
.ColumnHeadersDefaultCellStyle = new() { BackColor = Color.Red };
3170
_dataGridView
.ColumnHeadersDefaultCellStyleChanged -= handler;
3171
_dataGridView
.ColumnHeadersDefaultCellStyle = new();
3181
sender.Should().Be(
_dataGridView
);
3186
_dataGridView
.DataMemberChanged += handler;
3187
_dataGridView
.DataMember = "TestMember";
3190
_dataGridView
.DataMemberChanged -= handler;
3191
_dataGridView
.DataMember = "AnotherTestMember";
3201
sender.Should().Be(
_dataGridView
);
3206
_dataGridView
.DataSourceChanged += handler;
3207
_dataGridView
.DataSource = new();
3210
_dataGridView
.DataSourceChanged -= handler;
3211
_dataGridView
.DataSource = new();
3221
sender.Should().Be(
_dataGridView
);
3226
_dataGridView
.DefaultCellStyleChanged += handler;
3227
_dataGridView
.DefaultCellStyle = new() { BackColor = Color.Red };
3230
_dataGridView
.DefaultCellStyleChanged -= handler;
3231
_dataGridView
.DefaultCellStyle = new();
3241
sender.Should().Be(
_dataGridView
);
3246
_dataGridView
.EditModeChanged += handler;
3247
_dataGridView
.EditMode = DataGridViewEditMode.EditOnEnter;
3250
_dataGridView
.EditModeChanged -= handler;
3251
_dataGridView
.EditMode = DataGridViewEditMode.EditOnKeystroke;
3261
sender.Should().Be(
_dataGridView
);
3266
_dataGridView
.GridColorChanged += handler;
3267
_dataGridView
.GridColor = Color.Red;
3270
_dataGridView
.GridColorChanged -= handler;
3271
_dataGridView
.GridColor = Color.Blue;
3281
sender.Should().Be(
_dataGridView
);
3286
_dataGridView
.MultiSelectChanged += handler;
3287
_dataGridView
.MultiSelect = false;
3290
_dataGridView
.MultiSelectChanged -= handler;
3291
_dataGridView
.MultiSelect = true;
3301
sender.Should().Be(
_dataGridView
);
3306
_dataGridView
.ReadOnlyChanged += handler;
3307
_dataGridView
.ReadOnly = true;
3310
_dataGridView
.ReadOnlyChanged -= handler;
3311
_dataGridView
.ReadOnly = false;
3321
sender.Should().Be(
_dataGridView
);
3326
_dataGridView
.RowHeadersBorderStyleChanged += handler;
3327
_dataGridView
.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
3330
_dataGridView
.RowHeadersBorderStyleChanged -= handler;
3331
_dataGridView
.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised;
3341
sender.Should().Be(
_dataGridView
);
3346
_dataGridView
.RowHeadersDefaultCellStyleChanged += handler;
3347
_dataGridView
.RowHeadersDefaultCellStyle = new();
3350
_dataGridView
.RowHeadersDefaultCellStyleChanged -= handler;
3351
_dataGridView
.RowHeadersDefaultCellStyle = new();
3361
sender.Should().Be(
_dataGridView
);
3366
_dataGridView
.RowsDefaultCellStyleChanged += handler;
3367
_dataGridView
.RowsDefaultCellStyle = new() { BackColor = Color.Red };
3370
_dataGridView
.RowsDefaultCellStyleChanged -= handler;
3371
_dataGridView
.RowsDefaultCellStyle = new();
3381
sender.Should().Be(
_dataGridView
);
3386
_dataGridView
.Columns.Add("Column1", "Column1");
3387
_dataGridView
.Rows.Add();
3388
_dataGridView
.Rows.Add();
3390
_dataGridView
.CurrentCellChanged += handler;
3391
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3394
_dataGridView
.CurrentCellChanged -= handler;
3395
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3405
sender.Should().Be(
_dataGridView
);
3410
_dataGridView
.Columns.Add("Column1", "Column1");
3411
_dataGridView
.Rows.Add();
3412
_dataGridView
.Rows.Add();
3414
_dataGridView
.CurrentCellDirtyStateChanged += handler;
3415
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3416
_dataGridView
[0, 0].Value = true;
3417
_dataGridView
.NotifyCurrentCellDirty(true);
3420
_dataGridView
.CurrentCellDirtyStateChanged -= handler;
3421
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3422
_dataGridView
[0, 1].Value = true;
3423
_dataGridView
.NotifyCurrentCellDirty(true);
3433
sender.Should().Be(
_dataGridView
);
3438
_dataGridView
.Columns.Add("Column1", "Column1");
3439
_dataGridView
.Rows.Add();
3440
_dataGridView
.Rows.Add();
3442
_dataGridView
.SelectionChanged += handler;
3443
_dataGridView
.ClearSelection();
3444
_dataGridView
.Rows[0].Selected = true;
3447
_dataGridView
.SelectionChanged -= handler;
3448
_dataGridView
.ClearSelection();
3449
_dataGridView
.Rows[1].Selected = true;
3459
sender.Should().Be(
_dataGridView
);
3464
_dataGridView
.Columns.Add("Column1", "Column1");
3465
_dataGridView
.Rows.Add("B");
3466
_dataGridView
.Rows.Add("A");
3468
_dataGridView
.Sorted += handler;
3469
_dataGridView
.Sort(
_dataGridView
.Columns[0], ListSortDirection.Ascending);
3472
_dataGridView
.Sorted -= handler;
3473
_dataGridView
.Sort(
_dataGridView
.Columns[0], ListSortDirection.Descending);
3535
sender.Should().Be(
_dataGridView
);
3543
eventInfo.AddEventHandler(
_dataGridView
, handler);
3544
propertyInfo.SetValue(
_dataGridView
, propertyValue, null);
3547
eventInfo.RemoveEventHandler(
_dataGridView
, handler);
3548
propertyInfo.SetValue(
_dataGridView
, newPropertyValue, null);
3558
sender.Should().Be(
_dataGridView
);
3563
_dataGridView
.AutoSizeColumnsModeChanged += handler;
3564
_dataGridView
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
3567
_dataGridView
.AutoSizeColumnsModeChanged -= handler;
3568
_dataGridView
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
3578
sender.Should().Be(
_dataGridView
);
3583
_dataGridView
.AutoSizeRowsModeChanged += handler;
3584
_dataGridView
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
3587
_dataGridView
.AutoSizeRowsModeChanged -= handler;
3588
_dataGridView
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
3625
sender.Should().Be(
_dataGridView
);
3630
_dataGridView
.Columns.Add("Column1", "Column1");
3631
_dataGridView
.Rows.Add("A");
3632
_dataGridView
.Rows.Add("B");
3634
_dataGridView
.CellEndEdit += handler;
3635
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3636
_dataGridView
.BeginEdit(false);
3637
_dataGridView
.EndEdit();
3640
_dataGridView
.CellEndEdit -= handler;
3641
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3642
_dataGridView
.BeginEdit(false);
3643
_dataGridView
.EndEdit();
3653
sender.Should().Be(
_dataGridView
);
3658
_dataGridView
.Columns.Add("Column1", "Column1");
3659
_dataGridView
.Rows.Add("A");
3660
_dataGridView
.Rows.Add("B");
3662
_dataGridView
.CellEnter += handler;
3663
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3666
_dataGridView
.CellEnter -= handler;
3667
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3863
sender.Should().Be(
_dataGridView
);
3868
_dataGridView
.Columns.Add("Column1", "Column1");
3869
_dataGridView
.Columns.Add("Column2", "Column2");
3871
_dataGridView
.ColumnHeaderCellChanged += handler;
3872
_dataGridView
.Columns[0].HeaderCell = new();
3875
_dataGridView
.ColumnHeaderCellChanged -= handler;
3876
_dataGridView
.Columns[1].HeaderCell = new();
3886
sender.Should().Be(
_dataGridView
);
3891
_dataGridView
.Columns.Add("Column1", "Column1");
3893
_dataGridView
.ColumnMinimumWidthChanged += handler;
3894
_dataGridView
.Columns[0].MinimumWidth = 50;
3897
_dataGridView
.ColumnMinimumWidthChanged -= handler;
3898
_dataGridView
.Columns[0].MinimumWidth = 100;
3908
sender.Should().Be(
_dataGridView
);
3913
_dataGridView
.Columns.Add("Column1", "Column1");
3915
_dataGridView
.ColumnNameChanged += handler;
3916
_dataGridView
.Columns[0].Name = "TestName1";
3919
_dataGridView
.ColumnNameChanged -= handler;
3920
_dataGridView
.Columns[0].Name = "TestName2";
3930
sender.Should().Be(
_dataGridView
);
3935
_dataGridView
.Columns.Add("Column1", "Column1");
3936
_dataGridView
.Columns.Add("Column2", "Column2");
3938
_dataGridView
.ColumnRemoved += handler;
3939
_dataGridView
.Columns.Remove("Column2");
3942
_dataGridView
.ColumnRemoved -= handler;
3943
_dataGridView
.Columns.Remove("Column1");
3953
sender.Should().Be(
_dataGridView
);
3958
_dataGridView
.Columns.Add("Column1", "Column1");
3960
_dataGridView
.ColumnSortModeChanged += handler;
3961
_dataGridView
.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
3964
_dataGridView
.ColumnSortModeChanged -= handler;
3965
_dataGridView
.Columns[0].SortMode = DataGridViewColumnSortMode.Automatic;
3975
sender.Should().Be(
_dataGridView
);
3980
_dataGridView
.Columns.Add("Column1", "Column1");
3982
_dataGridView
.ColumnToolTipTextChanged += handler;
3983
_dataGridView
.Columns[0].ToolTipText = "ToolTip Text";
3986
_dataGridView
.ColumnToolTipTextChanged -= handler;
3987
_dataGridView
.Columns[0].ToolTipText = "New ToolTip Text";
3997
sender.Should().Be(
_dataGridView
);
4002
_dataGridView
.Columns.Add("Column1", "Column1");
4004
_dataGridView
.ColumnWidthChanged += handler;
4005
_dataGridView
.Columns[0].Width = 50;
4008
_dataGridView
.ColumnWidthChanged -= handler;
4009
_dataGridView
.Columns[0].Width = 100;
4019
sender.Should().Be(
_dataGridView
);
4037
_dataGridView
.DataBindingComplete += handler;
4038
_dataGridView
.BindingContext = context1;
4039
_dataGridView
.DataSource = bindingSource1;
4042
_dataGridView
.DataBindingComplete -= handler;
4043
_dataGridView
.BindingContext = context2;
4044
_dataGridView
.DataSource = bindingSource2;
4054
sender.Should().Be(
_dataGridView
);
4059
_dataGridView
.Columns.Add("Column1", "Column 1");
4060
_dataGridView
.Columns.Add("Column2", "Column 2");
4061
_dataGridView
.AllowUserToAddRows = true;
4063
_dataGridView
.DefaultValuesNeeded += handler;
4064
_dataGridView
.CurrentCell =
_dataGridView
.Rows[
_dataGridView
.NewRowIndex].Cells[0];
4067
_dataGridView
.DefaultValuesNeeded -= handler;
4068
_dataGridView
.CurrentCell =
_dataGridView
.Rows[
_dataGridView
.NewRowIndex].Cells[1];