1 write to _dataGridView
System.Windows.Forms.Tests (1)
System\Windows\Forms\DataGridViewTests.cs (1)
24
_dataGridView
= new();
269 references to _dataGridView
System.Windows.Forms.Tests (269)
System\Windows\Forms\DataGridViewTests.cs (269)
27
public void Dispose() =>
_dataGridView
.Dispose();
2943
sender.Should().Be(
_dataGridView
);
2948
_dataGridView
.AllowUserToAddRowsChanged += handler;
2949
_dataGridView
.AllowUserToAddRows = !
_dataGridView
.AllowUserToAddRows;
2952
_dataGridView
.AllowUserToAddRowsChanged -= handler;
2953
_dataGridView
.AllowUserToAddRows = !
_dataGridView
.AllowUserToAddRows;
2963
sender.Should().Be(
_dataGridView
);
2968
_dataGridView
.AllowUserToDeleteRowsChanged += handler;
2969
_dataGridView
.AllowUserToDeleteRows = !
_dataGridView
.AllowUserToDeleteRows;
2972
_dataGridView
.AllowUserToDeleteRowsChanged -= handler;
2973
_dataGridView
.AllowUserToDeleteRows = !
_dataGridView
.AllowUserToDeleteRows;
2983
sender.Should().Be(
_dataGridView
);
2988
_dataGridView
.AllowUserToOrderColumnsChanged += handler;
2989
_dataGridView
.AllowUserToOrderColumns = !
_dataGridView
.AllowUserToOrderColumns;
2992
_dataGridView
.AllowUserToOrderColumnsChanged -= handler;
2993
_dataGridView
.AllowUserToOrderColumns = !
_dataGridView
.AllowUserToOrderColumns;
3003
sender.Should().Be(
_dataGridView
);
3008
_dataGridView
.AllowUserToResizeColumnsChanged += handler;
3009
_dataGridView
.AllowUserToResizeColumns = !
_dataGridView
.AllowUserToResizeColumns;
3012
_dataGridView
.AllowUserToResizeColumnsChanged -= handler;
3013
_dataGridView
.AllowUserToResizeColumns = !
_dataGridView
.AllowUserToResizeColumns;
3023
sender.Should().Be(
_dataGridView
);
3028
_dataGridView
.AllowUserToResizeRowsChanged += handler;
3029
_dataGridView
.AllowUserToResizeRows = !
_dataGridView
.AllowUserToResizeRows;
3032
_dataGridView
.AllowUserToResizeRowsChanged -= handler;
3033
_dataGridView
.AllowUserToResizeRows = !
_dataGridView
.AllowUserToResizeRows;
3043
sender.Should().Be(
_dataGridView
);
3048
_dataGridView
.AlternatingRowsDefaultCellStyleChanged += handler;
3049
_dataGridView
.AlternatingRowsDefaultCellStyle = new() { BackColor = Color.AliceBlue };
3052
_dataGridView
.AlternatingRowsDefaultCellStyleChanged -= handler;
3053
_dataGridView
.AlternatingRowsDefaultCellStyle = new();
3063
sender.Should().Be(
_dataGridView
);
3068
_dataGridView
.AutoGenerateColumnsChanged += handler;
3069
_dataGridView
.AutoGenerateColumns = !
_dataGridView
.AutoGenerateColumns;
3072
_dataGridView
.AutoGenerateColumnsChanged -= handler;
3073
_dataGridView
.AutoGenerateColumns = !
_dataGridView
.AutoGenerateColumns;
3083
sender.Should().Be(
_dataGridView
);
3088
_dataGridView
.BackgroundColorChanged += handler;
3089
_dataGridView
.BackgroundColor = Color.AliceBlue;
3092
_dataGridView
.BackgroundColorChanged -= handler;
3093
_dataGridView
.BackgroundColor = Color.Azure;
3103
sender.Should().Be(
_dataGridView
);
3108
_dataGridView
.BorderStyleChanged += handler;
3109
_dataGridView
.BorderStyle = BorderStyle.Fixed3D;
3112
_dataGridView
.BorderStyleChanged -= handler;
3113
_dataGridView
.BorderStyle = BorderStyle.FixedSingle;
3123
sender.Should().Be(
_dataGridView
);
3128
_dataGridView
.CellBorderStyleChanged += handler;
3129
_dataGridView
.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
3132
_dataGridView
.CellBorderStyleChanged -= handler;
3133
_dataGridView
.CellBorderStyle = DataGridViewCellBorderStyle.Single;
3143
sender.Should().Be(
_dataGridView
);
3148
_dataGridView
.ColumnHeadersBorderStyleChanged += handler;
3149
_dataGridView
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
3152
_dataGridView
.ColumnHeadersBorderStyleChanged -= handler;
3153
_dataGridView
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised;
3163
sender.Should().Be(
_dataGridView
);
3168
_dataGridView
.ColumnHeadersDefaultCellStyleChanged += handler;
3169
_dataGridView
.ColumnHeadersDefaultCellStyle = new() { BackColor = Color.Red };
3172
_dataGridView
.ColumnHeadersDefaultCellStyleChanged -= handler;
3173
_dataGridView
.ColumnHeadersDefaultCellStyle = new();
3183
sender.Should().Be(
_dataGridView
);
3188
_dataGridView
.DataMemberChanged += handler;
3189
_dataGridView
.DataMember = "TestMember";
3192
_dataGridView
.DataMemberChanged -= handler;
3193
_dataGridView
.DataMember = "AnotherTestMember";
3203
sender.Should().Be(
_dataGridView
);
3208
_dataGridView
.DataSourceChanged += handler;
3209
_dataGridView
.DataSource = new();
3212
_dataGridView
.DataSourceChanged -= handler;
3213
_dataGridView
.DataSource = new();
3223
sender.Should().Be(
_dataGridView
);
3228
_dataGridView
.DefaultCellStyleChanged += handler;
3229
_dataGridView
.DefaultCellStyle = new() { BackColor = Color.Red };
3232
_dataGridView
.DefaultCellStyleChanged -= handler;
3233
_dataGridView
.DefaultCellStyle = new();
3243
sender.Should().Be(
_dataGridView
);
3248
_dataGridView
.EditModeChanged += handler;
3249
_dataGridView
.EditMode = DataGridViewEditMode.EditOnEnter;
3252
_dataGridView
.EditModeChanged -= handler;
3253
_dataGridView
.EditMode = DataGridViewEditMode.EditOnKeystroke;
3263
sender.Should().Be(
_dataGridView
);
3268
_dataGridView
.GridColorChanged += handler;
3269
_dataGridView
.GridColor = Color.Red;
3272
_dataGridView
.GridColorChanged -= handler;
3273
_dataGridView
.GridColor = Color.Blue;
3283
sender.Should().Be(
_dataGridView
);
3288
_dataGridView
.MultiSelectChanged += handler;
3289
_dataGridView
.MultiSelect = false;
3292
_dataGridView
.MultiSelectChanged -= handler;
3293
_dataGridView
.MultiSelect = true;
3303
sender.Should().Be(
_dataGridView
);
3308
_dataGridView
.ReadOnlyChanged += handler;
3309
_dataGridView
.ReadOnly = true;
3312
_dataGridView
.ReadOnlyChanged -= handler;
3313
_dataGridView
.ReadOnly = false;
3323
sender.Should().Be(
_dataGridView
);
3328
_dataGridView
.RowHeadersBorderStyleChanged += handler;
3329
_dataGridView
.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
3332
_dataGridView
.RowHeadersBorderStyleChanged -= handler;
3333
_dataGridView
.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised;
3343
sender.Should().Be(
_dataGridView
);
3348
_dataGridView
.RowHeadersDefaultCellStyleChanged += handler;
3349
_dataGridView
.RowHeadersDefaultCellStyle = new();
3352
_dataGridView
.RowHeadersDefaultCellStyleChanged -= handler;
3353
_dataGridView
.RowHeadersDefaultCellStyle = new();
3363
sender.Should().Be(
_dataGridView
);
3368
_dataGridView
.RowsDefaultCellStyleChanged += handler;
3369
_dataGridView
.RowsDefaultCellStyle = new() { BackColor = Color.Red };
3372
_dataGridView
.RowsDefaultCellStyleChanged -= handler;
3373
_dataGridView
.RowsDefaultCellStyle = new();
3383
sender.Should().Be(
_dataGridView
);
3388
_dataGridView
.Columns.Add("Column1", "Column1");
3389
_dataGridView
.Rows.Add();
3390
_dataGridView
.Rows.Add();
3392
_dataGridView
.CurrentCellChanged += handler;
3393
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3396
_dataGridView
.CurrentCellChanged -= handler;
3397
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3407
sender.Should().Be(
_dataGridView
);
3412
_dataGridView
.Columns.Add("Column1", "Column1");
3413
_dataGridView
.Rows.Add();
3414
_dataGridView
.Rows.Add();
3416
_dataGridView
.CurrentCellDirtyStateChanged += handler;
3417
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3418
_dataGridView
[0, 0].Value = true;
3419
_dataGridView
.NotifyCurrentCellDirty(true);
3422
_dataGridView
.CurrentCellDirtyStateChanged -= handler;
3423
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3424
_dataGridView
[0, 1].Value = true;
3425
_dataGridView
.NotifyCurrentCellDirty(true);
3435
sender.Should().Be(
_dataGridView
);
3440
_dataGridView
.Columns.Add("Column1", "Column1");
3441
_dataGridView
.Rows.Add();
3442
_dataGridView
.Rows.Add();
3444
_dataGridView
.SelectionChanged += handler;
3445
_dataGridView
.ClearSelection();
3446
_dataGridView
.Rows[0].Selected = true;
3449
_dataGridView
.SelectionChanged -= handler;
3450
_dataGridView
.ClearSelection();
3451
_dataGridView
.Rows[1].Selected = true;
3461
sender.Should().Be(
_dataGridView
);
3466
_dataGridView
.Columns.Add("Column1", "Column1");
3467
_dataGridView
.Rows.Add("B");
3468
_dataGridView
.Rows.Add("A");
3470
_dataGridView
.Sorted += handler;
3471
_dataGridView
.Sort(
_dataGridView
.Columns[0], ListSortDirection.Ascending);
3474
_dataGridView
.Sorted -= handler;
3475
_dataGridView
.Sort(
_dataGridView
.Columns[0], ListSortDirection.Descending);
3537
sender.Should().Be(
_dataGridView
);
3545
eventInfo.AddEventHandler(
_dataGridView
, handler);
3546
propertyInfo.SetValue(
_dataGridView
, propertyValue, null);
3549
eventInfo.RemoveEventHandler(
_dataGridView
, handler);
3550
propertyInfo.SetValue(
_dataGridView
, newPropertyValue, null);
3560
sender.Should().Be(
_dataGridView
);
3565
_dataGridView
.AutoSizeColumnsModeChanged += handler;
3566
_dataGridView
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
3569
_dataGridView
.AutoSizeColumnsModeChanged -= handler;
3570
_dataGridView
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
3580
sender.Should().Be(
_dataGridView
);
3585
_dataGridView
.AutoSizeRowsModeChanged += handler;
3586
_dataGridView
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
3589
_dataGridView
.AutoSizeRowsModeChanged -= handler;
3590
_dataGridView
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
3627
sender.Should().Be(
_dataGridView
);
3632
_dataGridView
.Columns.Add("Column1", "Column1");
3633
_dataGridView
.Rows.Add("A");
3634
_dataGridView
.Rows.Add("B");
3636
_dataGridView
.CellEndEdit += handler;
3637
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3638
_dataGridView
.BeginEdit(false);
3639
_dataGridView
.EndEdit();
3642
_dataGridView
.CellEndEdit -= handler;
3643
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3644
_dataGridView
.BeginEdit(false);
3645
_dataGridView
.EndEdit();
3655
sender.Should().Be(
_dataGridView
);
3660
_dataGridView
.Columns.Add("Column1", "Column1");
3661
_dataGridView
.Rows.Add("A");
3662
_dataGridView
.Rows.Add("B");
3664
_dataGridView
.CellEnter += handler;
3665
_dataGridView
.CurrentCell =
_dataGridView
[0, 0];
3668
_dataGridView
.CellEnter -= handler;
3669
_dataGridView
.CurrentCell =
_dataGridView
[0, 1];
3865
sender.Should().Be(
_dataGridView
);
3870
_dataGridView
.Columns.Add("Column1", "Column1");
3871
_dataGridView
.Columns.Add("Column2", "Column2");
3873
_dataGridView
.ColumnHeaderCellChanged += handler;
3874
_dataGridView
.Columns[0].HeaderCell = new();
3877
_dataGridView
.ColumnHeaderCellChanged -= handler;
3878
_dataGridView
.Columns[1].HeaderCell = new();
3888
sender.Should().Be(
_dataGridView
);
3893
_dataGridView
.Columns.Add("Column1", "Column1");
3895
_dataGridView
.ColumnMinimumWidthChanged += handler;
3896
_dataGridView
.Columns[0].MinimumWidth = 50;
3899
_dataGridView
.ColumnMinimumWidthChanged -= handler;
3900
_dataGridView
.Columns[0].MinimumWidth = 100;
3910
sender.Should().Be(
_dataGridView
);
3915
_dataGridView
.Columns.Add("Column1", "Column1");
3917
_dataGridView
.ColumnNameChanged += handler;
3918
_dataGridView
.Columns[0].Name = "TestName1";
3921
_dataGridView
.ColumnNameChanged -= handler;
3922
_dataGridView
.Columns[0].Name = "TestName2";
3932
sender.Should().Be(
_dataGridView
);
3937
_dataGridView
.Columns.Add("Column1", "Column1");
3938
_dataGridView
.Columns.Add("Column2", "Column2");
3940
_dataGridView
.ColumnRemoved += handler;
3941
_dataGridView
.Columns.Remove("Column2");
3944
_dataGridView
.ColumnRemoved -= handler;
3945
_dataGridView
.Columns.Remove("Column1");
3955
sender.Should().Be(
_dataGridView
);
3960
_dataGridView
.Columns.Add("Column1", "Column1");
3962
_dataGridView
.ColumnSortModeChanged += handler;
3963
_dataGridView
.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
3966
_dataGridView
.ColumnSortModeChanged -= handler;
3967
_dataGridView
.Columns[0].SortMode = DataGridViewColumnSortMode.Automatic;
3977
sender.Should().Be(
_dataGridView
);
3982
_dataGridView
.Columns.Add("Column1", "Column1");
3984
_dataGridView
.ColumnToolTipTextChanged += handler;
3985
_dataGridView
.Columns[0].ToolTipText = "ToolTip Text";
3988
_dataGridView
.ColumnToolTipTextChanged -= handler;
3989
_dataGridView
.Columns[0].ToolTipText = "New ToolTip Text";
3999
sender.Should().Be(
_dataGridView
);
4004
_dataGridView
.Columns.Add("Column1", "Column1");
4006
_dataGridView
.ColumnWidthChanged += handler;
4007
_dataGridView
.Columns[0].Width = 50;
4010
_dataGridView
.ColumnWidthChanged -= handler;
4011
_dataGridView
.Columns[0].Width = 100;
4021
sender.Should().Be(
_dataGridView
);
4039
_dataGridView
.DataBindingComplete += handler;
4040
_dataGridView
.BindingContext = context1;
4041
_dataGridView
.DataSource = bindingSource1;
4044
_dataGridView
.DataBindingComplete -= handler;
4045
_dataGridView
.BindingContext = context2;
4046
_dataGridView
.DataSource = bindingSource2;
4056
sender.Should().Be(
_dataGridView
);
4061
_dataGridView
.Columns.Add("Column1", "Column 1");
4062
_dataGridView
.Columns.Add("Column2", "Column 2");
4063
_dataGridView
.AllowUserToAddRows = true;
4065
_dataGridView
.DefaultValuesNeeded += handler;
4066
_dataGridView
.CurrentCell =
_dataGridView
.Rows[
_dataGridView
.NewRowIndex].Cells[0];
4069
_dataGridView
.DefaultValuesNeeded -= handler;
4070
_dataGridView
.CurrentCell =
_dataGridView
.Rows[
_dataGridView
.NewRowIndex].Cells[1];