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)
25public void Dispose() => _dataGridView.Dispose(); 2941sender.Should().Be(_dataGridView); 2946_dataGridView.AllowUserToAddRowsChanged += handler; 2947_dataGridView.AllowUserToAddRows = !_dataGridView.AllowUserToAddRows; 2950_dataGridView.AllowUserToAddRowsChanged -= handler; 2951_dataGridView.AllowUserToAddRows = !_dataGridView.AllowUserToAddRows; 2961sender.Should().Be(_dataGridView); 2966_dataGridView.AllowUserToDeleteRowsChanged += handler; 2967_dataGridView.AllowUserToDeleteRows = !_dataGridView.AllowUserToDeleteRows; 2970_dataGridView.AllowUserToDeleteRowsChanged -= handler; 2971_dataGridView.AllowUserToDeleteRows = !_dataGridView.AllowUserToDeleteRows; 2981sender.Should().Be(_dataGridView); 2986_dataGridView.AllowUserToOrderColumnsChanged += handler; 2987_dataGridView.AllowUserToOrderColumns = !_dataGridView.AllowUserToOrderColumns; 2990_dataGridView.AllowUserToOrderColumnsChanged -= handler; 2991_dataGridView.AllowUserToOrderColumns = !_dataGridView.AllowUserToOrderColumns; 3001sender.Should().Be(_dataGridView); 3006_dataGridView.AllowUserToResizeColumnsChanged += handler; 3007_dataGridView.AllowUserToResizeColumns = !_dataGridView.AllowUserToResizeColumns; 3010_dataGridView.AllowUserToResizeColumnsChanged -= handler; 3011_dataGridView.AllowUserToResizeColumns = !_dataGridView.AllowUserToResizeColumns; 3021sender.Should().Be(_dataGridView); 3026_dataGridView.AllowUserToResizeRowsChanged += handler; 3027_dataGridView.AllowUserToResizeRows = !_dataGridView.AllowUserToResizeRows; 3030_dataGridView.AllowUserToResizeRowsChanged -= handler; 3031_dataGridView.AllowUserToResizeRows = !_dataGridView.AllowUserToResizeRows; 3041sender.Should().Be(_dataGridView); 3046_dataGridView.AlternatingRowsDefaultCellStyleChanged += handler; 3047_dataGridView.AlternatingRowsDefaultCellStyle = new() { BackColor = Color.AliceBlue }; 3050_dataGridView.AlternatingRowsDefaultCellStyleChanged -= handler; 3051_dataGridView.AlternatingRowsDefaultCellStyle = new(); 3061sender.Should().Be(_dataGridView); 3066_dataGridView.AutoGenerateColumnsChanged += handler; 3067_dataGridView.AutoGenerateColumns = !_dataGridView.AutoGenerateColumns; 3070_dataGridView.AutoGenerateColumnsChanged -= handler; 3071_dataGridView.AutoGenerateColumns = !_dataGridView.AutoGenerateColumns; 3081sender.Should().Be(_dataGridView); 3086_dataGridView.BackgroundColorChanged += handler; 3087_dataGridView.BackgroundColor = Color.AliceBlue; 3090_dataGridView.BackgroundColorChanged -= handler; 3091_dataGridView.BackgroundColor = Color.Azure; 3101sender.Should().Be(_dataGridView); 3106_dataGridView.BorderStyleChanged += handler; 3107_dataGridView.BorderStyle = BorderStyle.Fixed3D; 3110_dataGridView.BorderStyleChanged -= handler; 3111_dataGridView.BorderStyle = BorderStyle.FixedSingle; 3121sender.Should().Be(_dataGridView); 3126_dataGridView.CellBorderStyleChanged += handler; 3127_dataGridView.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical; 3130_dataGridView.CellBorderStyleChanged -= handler; 3131_dataGridView.CellBorderStyle = DataGridViewCellBorderStyle.Single; 3141sender.Should().Be(_dataGridView); 3146_dataGridView.ColumnHeadersBorderStyleChanged += handler; 3147_dataGridView.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; 3150_dataGridView.ColumnHeadersBorderStyleChanged -= handler; 3151_dataGridView.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised; 3161sender.Should().Be(_dataGridView); 3166_dataGridView.ColumnHeadersDefaultCellStyleChanged += handler; 3167_dataGridView.ColumnHeadersDefaultCellStyle = new() { BackColor = Color.Red }; 3170_dataGridView.ColumnHeadersDefaultCellStyleChanged -= handler; 3171_dataGridView.ColumnHeadersDefaultCellStyle = new(); 3181sender.Should().Be(_dataGridView); 3186_dataGridView.DataMemberChanged += handler; 3187_dataGridView.DataMember = "TestMember"; 3190_dataGridView.DataMemberChanged -= handler; 3191_dataGridView.DataMember = "AnotherTestMember"; 3201sender.Should().Be(_dataGridView); 3206_dataGridView.DataSourceChanged += handler; 3207_dataGridView.DataSource = new(); 3210_dataGridView.DataSourceChanged -= handler; 3211_dataGridView.DataSource = new(); 3221sender.Should().Be(_dataGridView); 3226_dataGridView.DefaultCellStyleChanged += handler; 3227_dataGridView.DefaultCellStyle = new() { BackColor = Color.Red }; 3230_dataGridView.DefaultCellStyleChanged -= handler; 3231_dataGridView.DefaultCellStyle = new(); 3241sender.Should().Be(_dataGridView); 3246_dataGridView.EditModeChanged += handler; 3247_dataGridView.EditMode = DataGridViewEditMode.EditOnEnter; 3250_dataGridView.EditModeChanged -= handler; 3251_dataGridView.EditMode = DataGridViewEditMode.EditOnKeystroke; 3261sender.Should().Be(_dataGridView); 3266_dataGridView.GridColorChanged += handler; 3267_dataGridView.GridColor = Color.Red; 3270_dataGridView.GridColorChanged -= handler; 3271_dataGridView.GridColor = Color.Blue; 3281sender.Should().Be(_dataGridView); 3286_dataGridView.MultiSelectChanged += handler; 3287_dataGridView.MultiSelect = false; 3290_dataGridView.MultiSelectChanged -= handler; 3291_dataGridView.MultiSelect = true; 3301sender.Should().Be(_dataGridView); 3306_dataGridView.ReadOnlyChanged += handler; 3307_dataGridView.ReadOnly = true; 3310_dataGridView.ReadOnlyChanged -= handler; 3311_dataGridView.ReadOnly = false; 3321sender.Should().Be(_dataGridView); 3326_dataGridView.RowHeadersBorderStyleChanged += handler; 3327_dataGridView.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; 3330_dataGridView.RowHeadersBorderStyleChanged -= handler; 3331_dataGridView.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised; 3341sender.Should().Be(_dataGridView); 3346_dataGridView.RowHeadersDefaultCellStyleChanged += handler; 3347_dataGridView.RowHeadersDefaultCellStyle = new(); 3350_dataGridView.RowHeadersDefaultCellStyleChanged -= handler; 3351_dataGridView.RowHeadersDefaultCellStyle = new(); 3361sender.Should().Be(_dataGridView); 3366_dataGridView.RowsDefaultCellStyleChanged += handler; 3367_dataGridView.RowsDefaultCellStyle = new() { BackColor = Color.Red }; 3370_dataGridView.RowsDefaultCellStyleChanged -= handler; 3371_dataGridView.RowsDefaultCellStyle = new(); 3381sender.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]; 3405sender.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); 3433sender.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; 3459sender.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); 3535sender.Should().Be(_dataGridView); 3543eventInfo.AddEventHandler(_dataGridView, handler); 3544propertyInfo.SetValue(_dataGridView, propertyValue, null); 3547eventInfo.RemoveEventHandler(_dataGridView, handler); 3548propertyInfo.SetValue(_dataGridView, newPropertyValue, null); 3558sender.Should().Be(_dataGridView); 3563_dataGridView.AutoSizeColumnsModeChanged += handler; 3564_dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; 3567_dataGridView.AutoSizeColumnsModeChanged -= handler; 3568_dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; 3578sender.Should().Be(_dataGridView); 3583_dataGridView.AutoSizeRowsModeChanged += handler; 3584_dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; 3587_dataGridView.AutoSizeRowsModeChanged -= handler; 3588_dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells; 3625sender.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(); 3653sender.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]; 3863sender.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(); 3886sender.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; 3908sender.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"; 3930sender.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"); 3953sender.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; 3975sender.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"; 3997sender.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; 4019sender.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; 4054sender.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];