409 references to DataGridViewCellStyle
PresentationUI (2)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (2)
461
_textCellStyle = new
DataGridViewCellStyle
469
_boolCellStyle = new
DataGridViewCellStyle
System.Windows.Forms (22)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (6)
802
_alternatingRowsDefaultCellStyle = new
DataGridViewCellStyle
();
1539
DataGridViewCellStyle defaultStyle = new
DataGridViewCellStyle
2052
DataGridViewCellStyle defaultCellStyle = new
DataGridViewCellStyle
2089
DataGridViewCellStyle defaultStyle = new
DataGridViewCellStyle
3048
internal DataGridViewCellStyle PlaceholderCellStyle => _placeholderCellStyle ??= new
DataGridViewCellStyle
();
3493
_rowsDefaultCellStyle = new
DataGridViewCellStyle
();
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
19347
DataGridViewCellStyle inheritedCellStyle =
new
();
19680
DataGridViewCellStyle inheritedCellStyle =
new
();
28134
DataGridViewCellStyle defaultStyle =
new
();
28155
DataGridViewCellStyle defaultStyle =
new
();
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
87
style = new
DataGridViewCellStyle
();
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (1)
19
DataGridViewCellStyle defaultCellStyle = new
DataGridViewCellStyle
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
624
dataGridViewCellStyle = new
DataGridViewCellStyle
();
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (1)
20
DataGridViewCellStyle defaultCellStyle = new
DataGridViewCellStyle
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (1)
441
DataGridViewCellStyle inheritedCellStyleTmp =
new
();
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (1)
284
DataGridViewCellStyle inheritedCellStyleTmp = inheritedCellStyle ?? new
DataGridViewCellStyle
();
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (1)
25
DataGridViewCellStyle defaultCellStyle =
new
()
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (4)
236
DataGridViewCellStyle inheritedRowStyle =
new
();
1427
DataGridViewCellStyle inheritedRowStyle =
new
();
1511
DataGridViewCellStyle inheritedCellStyle =
new
();
1712
DataGridViewCellStyle inheritedCellStyle =
new
();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
309
DataGridViewCellStyle inheritedCellStyleTmp = inheritedCellStyle ?? new
DataGridViewCellStyle
();
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\DataGridViewCellStyleBuilderTests.cs (1)
19
builder.CellStyle = new
DataGridViewCellStyle
{ BackColor = Color.Red };
System\Windows\Forms\Design\FormatStringEditorTests.cs (1)
25
_cellStyle =
new
() { Format = "Initial" };
System.Windows.Forms.Tests (381)
System\Windows\Forms\DataGridViewButtonColumnTests.cs (2)
152
DataGridViewCellStyle newStyle = new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomRight };
178
_column.DefaultCellStyle = new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomRight };
System\Windows\Forms\DataGridViewCellFormattingEventArgsTests.cs (5)
14
yield return new object[] { 0, 0, "value", typeof(string), new
DataGridViewCellStyle
() };
15
yield return new object[] { 1, 2, "value", typeof(string), new
DataGridViewCellStyle
() };
46
yield return new object[] { new
DataGridViewCellStyle
() };
53
DataGridViewCellFormattingEventArgs e = new(1, 2, "value", typeof(string), new
DataGridViewCellStyle
())
65
DataGridViewCellFormattingEventArgs e = new(1, 2, "value", typeof(string), new
DataGridViewCellStyle
())
System\Windows\Forms\DataGridViewCellPaintingEventArgsTests.cs (18)
14
yield return new object[] { Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All };
15
yield return new object[] { new Rectangle(-1, -2, -3, -4), new Rectangle(-1, -2, -3, -4), -1, -1, DataGridViewElementStates.Displayed, "value", "formattedValue", "", new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All };
16
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 0, 1, (DataGridViewElementStates)7, "value", "formattedValue", "errorText", new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All };
48
Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewCellPaintingEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All));
55
Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewCellPaintingEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All));
74
Assert.Throws<ArgumentException>("paintParts", () => new DataGridViewCellPaintingEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, paintParts));
86
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All);
97
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, 0, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
110
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, 0, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
123
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
136
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All);
147
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, 0, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
160
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, 0, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
173
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
186
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All);
197
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, 0, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
210
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, 0, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
223
DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new
DataGridViewCellStyle
(), null, DataGridViewPaintParts.All);
System\Windows\Forms\DataGridViewCellParsingEventArgsTests.cs (5)
15
yield return new object[] { 0, 0, "value", typeof(string), new
DataGridViewCellStyle
() };
16
yield return new object[] { 1, 2, "value", typeof(string), new
DataGridViewCellStyle
() };
35
yield return new object[] { new
DataGridViewCellStyle
() };
42
DataGridViewCellParsingEventArgs e = new(1, 2, "value", typeof(string), new
DataGridViewCellStyle
())
54
DataGridViewCellParsingEventArgs e = new(1, 2, "value", typeof(string), new
DataGridViewCellStyle
())
System\Windows\Forms\DataGridViewCellStyleConverterTests.cs (1)
17
_style =
new
();
System\Windows\Forms\DataGridViewCellStyleTests.cs (126)
18
DataGridViewCellStyle style =
new
();
42
DataGridViewCellStyle source =
new
()
82
DataGridViewCellStyle source =
new
();
114
DataGridViewCellStyle style =
new
()
129
DataGridViewCellStyle style =
new
();
137
DataGridViewCellStyle style =
new
()
151
DataGridViewCellStyle style =
new
()
172
DataGridViewCellStyle style =
new
()
189
DataGridViewCellStyle style =
new
()
207
DataGridViewCellStyle style =
new
()
225
DataGridViewCellStyle style =
new
()
238
DataGridViewCellStyle style =
new
()
250
DataGridViewCellStyle style =
new
()
269
DataGridViewCellStyle style =
new
()
283
DataGridViewCellStyle style =
new
()
295
DataGridViewCellStyle style =
new
()
309
DataGridViewCellStyle style =
new
()
321
DataGridViewCellStyle style =
new
()
336
DataGridViewCellStyle style =
new
()
356
DataGridViewCellStyle style =
new
()
372
DataGridViewCellStyle style =
new
()
394
DataGridViewCellStyle style =
new
()
411
DataGridViewCellStyle style =
new
()
429
DataGridViewCellStyle style =
new
()
447
DataGridViewCellStyle style =
new
()
460
DataGridViewCellStyle style =
new
()
472
DataGridViewCellStyle style =
new
()
498
DataGridViewCellStyle style =
new
()
513
DataGridViewCellStyle style =
new
()
527
DataGridViewCellStyle style =
new
()
539
DataGridViewCellStyle style =
new
()
553
DataGridViewCellStyle style =
new
()
565
DataGridViewCellStyle style =
new
()
580
DataGridViewCellStyle style =
new
()
596
DataGridViewCellStyle style =
new
()
611
DataGridViewCellStyle style =
new
();
619
DataGridViewCellStyle source =
new
()
635
DataGridViewCellStyle style =
new
();
661
DataGridViewCellStyle source =
new
();
662
DataGridViewCellStyle style =
new
()
702
DataGridViewCellStyle style =
new
();
710
DataGridViewCellStyle source =
new
()
750
DataGridViewCellStyle source =
new
();
776
ICloneable source = new
DataGridViewCellStyle
816
ICloneable source = new
DataGridViewCellStyle
();
843
yield return new object[] { new
DataGridViewCellStyle
(), new
DataGridViewCellStyle
(), true };
847
new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomCenter },
848
new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomCenter },
853
new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomCenter },
854
new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomRight },
859
new
DataGridViewCellStyle
{ BackColor = Color.Red },
860
new
DataGridViewCellStyle
{ BackColor = Color.Red },
865
new
DataGridViewCellStyle
{ BackColor = Color.Red },
866
new
DataGridViewCellStyle
{ BackColor = Color.Blue },
871
new
DataGridViewCellStyle
{ DataSourceNullValue = "dbNull" },
872
new
DataGridViewCellStyle
{ DataSourceNullValue = "dbNull" },
877
new
DataGridViewCellStyle
{ DataSourceNullValue = "dbNull" },
878
new
DataGridViewCellStyle
{ DataSourceNullValue = "other" },
883
new
DataGridViewCellStyle
{ DataSourceNullValue = null },
884
new
DataGridViewCellStyle
{ DataSourceNullValue = null },
889
new
DataGridViewCellStyle
{ DataSourceNullValue = null },
890
new
DataGridViewCellStyle
{ DataSourceNullValue = "other" },
895
new
DataGridViewCellStyle
{ ForeColor = Color.Red },
896
new
DataGridViewCellStyle
{ ForeColor = Color.Red },
901
new
DataGridViewCellStyle
{ ForeColor = Color.Red },
902
new
DataGridViewCellStyle
{ ForeColor = Color.Blue },
907
new
DataGridViewCellStyle
{ Font = font },
908
new
DataGridViewCellStyle
{ Font = font },
913
new
DataGridViewCellStyle
{ Font = font },
914
new
DataGridViewCellStyle
{ Font = SystemFonts.MenuFont },
919
new
DataGridViewCellStyle
{ Format = "format" },
920
new
DataGridViewCellStyle
{ Format = "format" },
925
new
DataGridViewCellStyle
{ Format = "format" },
926
new
DataGridViewCellStyle
{ Format = "other" },
931
new
DataGridViewCellStyle
{ FormatProvider = formatProvider },
932
new
DataGridViewCellStyle
{ FormatProvider = formatProvider },
937
new
DataGridViewCellStyle
{ FormatProvider = formatProvider },
938
new
DataGridViewCellStyle
{ FormatProvider = CultureInfo.CurrentCulture },
943
new
DataGridViewCellStyle
{ NullValue = "null" },
944
new
DataGridViewCellStyle
{ NullValue = "null" },
949
new
DataGridViewCellStyle
{ NullValue = "null" },
950
new
DataGridViewCellStyle
{ NullValue = "other" },
955
new
DataGridViewCellStyle
{ NullValue = null },
956
new
DataGridViewCellStyle
{ NullValue = null },
961
new
DataGridViewCellStyle
{ NullValue = null },
962
new
DataGridViewCellStyle
{ NullValue = "other" },
967
new
DataGridViewCellStyle
{ Padding = new Padding(1, 2, 3, 4) },
968
new
DataGridViewCellStyle
{ Padding = new Padding(1, 2, 3, 4) },
973
new
DataGridViewCellStyle
{ Padding = new Padding(1, 2, 3, 4) },
974
new
DataGridViewCellStyle
{ Padding = new Padding(2, 3, 4, 5) },
979
new
DataGridViewCellStyle
{ SelectionBackColor = Color.Red },
980
new
DataGridViewCellStyle
{ SelectionBackColor = Color.Red },
985
new
DataGridViewCellStyle
{ SelectionBackColor = Color.Red },
986
new
DataGridViewCellStyle
{ SelectionBackColor = Color.Blue },
991
new
DataGridViewCellStyle
{ SelectionForeColor = Color.Red },
992
new
DataGridViewCellStyle
{ SelectionForeColor = Color.Red },
997
new
DataGridViewCellStyle
{ SelectionForeColor = Color.Red },
998
new
DataGridViewCellStyle
{ SelectionForeColor = Color.Blue },
1003
new
DataGridViewCellStyle
{ Tag = "tag" },
1004
new
DataGridViewCellStyle
{ Tag = "tag" },
1009
new
DataGridViewCellStyle
{ Tag = "tag" },
1010
new
DataGridViewCellStyle
{ Tag = "other" },
1015
new
DataGridViewCellStyle
{ WrapMode = DataGridViewTriState.True },
1016
new
DataGridViewCellStyle
{ WrapMode = DataGridViewTriState.True },
1021
new
DataGridViewCellStyle
{ WrapMode = DataGridViewTriState.True },
1022
new
DataGridViewCellStyle
{ WrapMode = DataGridViewTriState.False },
1026
yield return new object[] { new
DataGridViewCellStyle
(), new(), false };
1027
yield return new object[] { new
DataGridViewCellStyle
(), null, false };
1044
yield return new object[] { new
DataGridViewCellStyle
(), "DataGridViewCellStyle { }" };
1047
new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomCenter },
1052
new
DataGridViewCellStyle
{ BackColor = Color.Red },
1057
new
DataGridViewCellStyle
{ DataSourceNullValue = "dbNull" },
1062
new
DataGridViewCellStyle
{ DataSourceNullValue = null },
1067
new
DataGridViewCellStyle
{ ForeColor = Color.Red },
1072
new
DataGridViewCellStyle
{ Font = SystemFonts.DefaultFont },
1077
new
DataGridViewCellStyle
{ Format = "format" },
1082
new
DataGridViewCellStyle
{ FormatProvider = new NumberFormatInfo() },
1087
new
DataGridViewCellStyle
{ NullValue = "null" },
1092
new
DataGridViewCellStyle
{ NullValue = null },
1097
new
DataGridViewCellStyle
{ Padding = new Padding(1, 2, 3, 4) },
1102
new
DataGridViewCellStyle
{ SelectionBackColor = Color.Red },
1107
new
DataGridViewCellStyle
{ SelectionForeColor = Color.Red },
1112
new
DataGridViewCellStyle
{ Tag = "tag" },
1117
new
DataGridViewCellStyle
{ WrapMode = DataGridViewTriState.True },
1124
new
DataGridViewCellStyle
System\Windows\Forms\DataGridViewCellTests.cs (81)
2242
yield return new object[] { null, new
DataGridViewCellStyle
() };
2244
DataGridViewCellStyle style =
new
() { Alignment = DataGridViewContentAlignment.BottomRight };
2269
DataGridViewCellStyle oldValue =
new
()
2309
DataGridViewCellStyle oldValue =
new
()
2352
DataGridViewCellStyle oldValue =
new
()
2400
DataGridViewCellStyle oldValue =
new
()
2446
DataGridViewCellStyle style1 =
new
()
2464
DataGridViewCellStyle style2 =
new
()
3323
Style = new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomLeft },
3356
Assert.Equal(new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomLeft }, cell.Style);
3393
Assert.Equal(new
DataGridViewCellStyle
(), cell.Style);
3660
yield return new object[] { new
DataGridViewCellStyle
(), -2 };
3661
yield return new object[] { new
DataGridViewCellStyle
(), -1 };
3662
yield return new object[] { new
DataGridViewCellStyle
(), 0 };
3663
yield return new object[] { new
DataGridViewCellStyle
(), 1 };
3812
yield return new object[] { new
DataGridViewCellStyle
(), -2 };
3813
yield return new object[] { new
DataGridViewCellStyle
(), -1 };
3814
yield return new object[] { new
DataGridViewCellStyle
(), 0 };
3815
yield return new object[] { new
DataGridViewCellStyle
(), 1 };
4138
yield return new object[] { "value", -2, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter(), DataGridViewDataErrorContexts.Formatting, null };
4139
yield return new object[] { "value", -1, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter(), DataGridViewDataErrorContexts.Formatting, null };
4140
yield return new object[] { "value", 0, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter(), DataGridViewDataErrorContexts.Formatting, null };
4701
Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new
DataGridViewCellStyle
(), -1, true));
4708
Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new
DataGridViewCellStyle
(), -1, true));
4717
Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new
DataGridViewCellStyle
(), -1, true));
4726
Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new
DataGridViewCellStyle
(), -1, true));
4743
Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedStyle(new
DataGridViewCellStyle
(), rowIndex, true));
5747
Style = new
DataGridViewCellStyle
()
6031
cell.PaintBorder(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle());
6038
Assert.Throws<ArgumentNullException>("graphics", () => cell.PaintBorder(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new
DataGridViewCellStyle
(), new DataGridViewAdvancedBorderStyle()));
6089
yield return new object[] { typeof(object), typeof(string), "value", new
DataGridViewCellStyle
(), null, null, "value" };
6090
yield return new object[] { typeof(string), typeof(string), "value", new
DataGridViewCellStyle
(), null, null, "value" };
6091
yield return new object[] { typeof(object), typeof(int), 1, new
DataGridViewCellStyle
(), null, null, 1 };
6092
yield return new object[] { typeof(int), typeof(int), 1, new
DataGridViewCellStyle
(), null, null, 1 };
6095
yield return new object[] { typeof(object), typeof(DBNull), DBNull.Value, new
DataGridViewCellStyle
(), null, null, null };
6096
yield return new object[] { typeof(string), typeof(string), "null", new
DataGridViewCellStyle
{ NullValue = "null" }, null, null, null };
6097
yield return new object[] { typeof(object), typeof(string), "null", new
DataGridViewCellStyle
{ NullValue = "null" }, null, null, null };
6098
yield return new object[] { typeof(object), typeof(string), "s", new
DataGridViewCellStyle
{ NullValue = "null" }, null, null, "s" };
6099
yield return new object[] { typeof(object), typeof(string), "longer", new
DataGridViewCellStyle
{ NullValue = "null" }, null, null, "longer" };
6100
yield return new object[] { typeof(object), typeof(string), "abcd", new
DataGridViewCellStyle
{ NullValue = "null" }, null, null, "abcd" };
6101
yield return new object[] { typeof(object), typeof(string), "null", new
DataGridViewCellStyle
{ NullValue = "null" }, null, null, null };
6102
yield return new object[] { typeof(int), typeof(int), 1, new
DataGridViewCellStyle
{ NullValue = 1 }, null, null, DBNull.Value };
6103
yield return new object[] { typeof(int), typeof(int), 2, new
DataGridViewCellStyle
{ NullValue = 1 }, null, null, 2 };
6104
yield return new object[] { typeof(string), typeof(string), "null", new
DataGridViewCellStyle
{ NullValue = "null", DataSourceNullValue = "dbNull" }, null, null, "dbNull" };
6105
yield return new object[] { typeof(int), typeof(int), 1, new
DataGridViewCellStyle
{ NullValue = 1, DataSourceNullValue = "dbNull" }, null, null, "dbNull" };
6108
yield return new object[] { typeof(string), typeof(int), 123, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter(), "123" };
6109
yield return new object[] { typeof(string), typeof(int), 123, new
DataGridViewCellStyle
(), new Int32Converter(), null, "123" };
6110
yield return new object[] { typeof(string), typeof(int), 123, new
DataGridViewCellStyle
(), null, new Int32Converter(), "123" };
6111
yield return new object[] { typeof(string), typeof(int?), 123, new
DataGridViewCellStyle
(), null, null, "123" };
6112
yield return new object[] { typeof(int), typeof(string), "123", new
DataGridViewCellStyle
(), null, null, 123 };
6113
yield return new object[] { typeof(int), typeof(string), "123", new
DataGridViewCellStyle
{ FormatProvider = CultureInfo.InvariantCulture }, null, null, 123 };
6114
yield return new object[] { typeof(int), typeof(string), "123", new
DataGridViewCellStyle
{ FormatProvider = new NumberFormatInfo() }, null, null, 123 };
6117
yield return new object[] { typeof(string), typeof(int), 123, new
DataGridViewCellStyle
(), new Int16Converter(), null, "123" };
6118
yield return new object[] { typeof(string), typeof(int), 123, new
DataGridViewCellStyle
(), null, new Int16Converter(), "123" };
6121
yield return new object[] { typeof(short), typeof(int), 123, new
DataGridViewCellStyle
(), null, null, (short)123 };
6122
yield return new object[] { typeof(short), typeof(int), 123, new
DataGridViewCellStyle
{ FormatProvider = CultureInfo.InvariantCulture }, null, null, (short)123 };
6123
yield return new object[] { typeof(short), typeof(int), 123, new
DataGridViewCellStyle
{ FormatProvider = new NumberFormatInfo() }, null, null, (short)123 };
6124
yield return new object[] { typeof(short?), typeof(int), 123, new
DataGridViewCellStyle
(), null, null, (short)123 };
6125
yield return new object[] { typeof(short), typeof(int?), 123, new
DataGridViewCellStyle
(), null, null, (short)123 };
6128
yield return new object[] { typeof(int?), typeof(int?), 123, new
DataGridViewCellStyle
(), null, null, 123 };
6129
yield return new object[] { typeof(int?), typeof(int), 123, new
DataGridViewCellStyle
(), null, null, 123 };
6130
yield return new object[] { typeof(int), typeof(int?), 123, new
DataGridViewCellStyle
(), null, null, 123 };
6131
yield return new object[] { typeof(string), typeof(int?), 123, new
DataGridViewCellStyle
(), null, null, "123" };
6134
yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Indeterminate, new
DataGridViewCellStyle
(), null, null, DBNull.Value };
6135
yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Checked, new
DataGridViewCellStyle
(), null, null, true };
6136
yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Unchecked, new
DataGridViewCellStyle
(), null, null, false };
6137
yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Unchecked - 1, new
DataGridViewCellStyle
(), null, null, false };
6138
yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Indeterminate + 1, new
DataGridViewCellStyle
(), null, null, false };
6139
yield return new object[] { typeof(CheckState), typeof(CheckState), CheckState.Checked, new
DataGridViewCellStyle
(), null, null, CheckState.Checked };
6140
yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new
DataGridViewCellStyle
(), null, null, 1 };
6141
yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new
DataGridViewCellStyle
(), new EnumConverter(typeof(CheckState)), null, 1 };
6142
yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new
DataGridViewCellStyle
(), null, new EnumConverter(typeof(CheckState)), 1 };
6171
Assert.Throws<FormatException>(() => cell.ParseFormattedValue(1, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter()));
6178
Assert.Throws<FormatException>(() => cell.ParseFormattedValue(1, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter()));
6185
Assert.Throws<FormatException>(() => cell.ParseFormattedValue(1, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter()));
6190
yield return new object[] { typeof(DataGridViewCellTests), typeof(int), 123, new
DataGridViewCellStyle
(), null, null };
6191
yield return new object[] { typeof(DataGridViewCell), typeof(DataGridViewCellTests), new DataGridViewCellTests(), new
DataGridViewCellStyle
(), null, null };
6192
yield return new object[] { typeof(int), typeof(string), "Invalid", new
DataGridViewCellStyle
(), null, null };
6217
Assert.Throws<ArgumentException>("formattedValue", () => cell.ParseFormattedValue(formattedValue, new
DataGridViewCellStyle
(), new Int32Converter(), new Int32Converter()));
6231
Assert.Throws<InvalidOperationException>(() => cell.PositionEditingControl(true, true, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new
DataGridViewCellStyle
(), true, true, true, true));
6238
Assert.Throws<InvalidOperationException>(() => cell.PositionEditingPanel(new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new
DataGridViewCellStyle
(), true, true, true, true));
System\Windows\Forms\DataGridViewColumnTests.cs (7)
740
yield return new object[] { null, new
DataGridViewCellStyle
() };
742
DataGridViewCellStyle style1 =
new
() { Alignment = DataGridViewContentAlignment.MiddleCenter };
743
DataGridViewCellStyle style2 =
new
() { Alignment = DataGridViewContentAlignment.BottomLeft };
769
DataGridViewCellStyle oldValue =
new
()
816
DataGridViewCellStyle oldValue =
new
()
861
DataGridViewCellStyle style1 =
new
()
879
DataGridViewCellStyle style2 =
new
()
System\Windows\Forms\DataGridViewEditingControlShowingEventArgsTests.cs (3)
13
yield return new object[] { null, new
DataGridViewCellStyle
() };
28
DataGridViewCellStyle cellStyle =
new
();
38
DataGridViewEditingControlShowingEventArgs e = new(button, new
DataGridViewCellStyle
());
System\Windows\Forms\DataGridViewHeaderCellTests.cs (6)
2025
Style = new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomLeft },
2058
Assert.Equal(new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomLeft }, cell.Style);
2095
Assert.Equal(new
DataGridViewCellStyle
(), cell.Style);
2111
Style = new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomLeft },
2144
Assert.Equal(new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.BottomLeft }, cell.Style);
2181
Assert.Equal(new
DataGridViewCellStyle
(), cell.Style);
System\Windows\Forms\DataGridViewRowPostPaintEventArgsTests.cs (17)
14
yield return new object[] { Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false };
15
yield return new object[] { new Rectangle(-1, -2, -3, -4), new Rectangle(-1, -2, -3, -4), -1, DataGridViewElementStates.Displayed, "", new
DataGridViewCellStyle
(), true, false };
16
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 0, (DataGridViewElementStates)7, "errorText", new
DataGridViewCellStyle
(), true, true };
44
Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewRowPostPaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false));
51
Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewRowPostPaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false));
77
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false)
91
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
104
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
115
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
128
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
139
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
152
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
163
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
176
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
187
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
200
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
213
DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
System\Windows\Forms\DataGridViewRowPrePaintEventArgsTests.cs (19)
17
yield return new object[] { new DataGridView(), graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false };
18
yield return new object[] { new DataGridView(), graphics, new Rectangle(-1, -2, -3, -4), new Rectangle(-1, -2, -3, -4), -1, DataGridViewElementStates.Displayed, "", new
DataGridViewCellStyle
(), true, false };
19
yield return new object[] { new DataGridView(), graphics, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 0, (DataGridViewElementStates)7, "errorText", new
DataGridViewCellStyle
(), true, true };
45
Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewRowPrePaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false));
52
Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewRowPrePaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false));
78
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false)
93
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false)
107
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
118
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
131
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
142
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
155
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
166
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
179
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
190
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
203
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
214
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
227
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
240
DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new
DataGridViewCellStyle
(), false, false);
System\Windows\Forms\DataGridViewRowTests.cs (25)
390
yield return new object[] { null, new
DataGridViewCellStyle
() };
392
DataGridViewCellStyle style1 =
new
() { Alignment = DataGridViewContentAlignment.MiddleCenter };
393
DataGridViewCellStyle style2 =
new
() { Alignment = DataGridViewContentAlignment.BottomLeft };
419
DataGridViewCellStyle oldValue =
new
()
465
DataGridViewCellStyle oldValue =
new
()
508
DataGridViewCellStyle style1 =
new
()
526
DataGridViewCellStyle style2 =
new
()
570
Assert.Throws<InvalidOperationException>(() => row.DefaultCellStyle = new
DataGridViewCellStyle
());
2063
DataGridViewCellStyle complete1 =
new
()
2079
DataGridViewCellStyle complete2 =
new
()
2102
1, new
DataGridViewCellStyle
(), complete1, null, null,
2112
1, null, new
DataGridViewCellStyle
(), complete1, null,
2122
1, null, null, new
DataGridViewCellStyle
(), complete1,
2132
2, null, null, new
DataGridViewCellStyle
(), complete1,
3926
DataGridViewCellStyle style =
new
() { Alignment = DataGridViewContentAlignment.BottomRight };
3966
DataGridViewCellStyle style =
new
()
4009
DataGridViewCellStyle style =
new
()
4186
yield return new object[] { Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, new
DataGridViewCellStyle
(), false };
4187
yield return new object[] { Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.None, new
DataGridViewCellStyle
(), false };
4188
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.Selected, new
DataGridViewCellStyle
{ BackColor = Color.Blue, SelectionBackColor = Color.Red }, true };
4189
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.Selected, new
DataGridViewCellStyle
{ BackColor = Color.Blue, SelectionBackColor = Color.Red }, true };
4190
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.None, new
DataGridViewCellStyle
{ BackColor = Color.Blue, SelectionBackColor = Color.Red }, true };
4191
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.None, new
DataGridViewCellStyle
{ BackColor = Color.Blue, SelectionBackColor = Color.Red }, false };
4217
Assert.Throws<InvalidOperationException>(() => row.DrawFocus(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, new
DataGridViewCellStyle
(), true));
4231
Assert.Throws<ArgumentNullException>("graphics", () => row.DrawFocus(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, new
DataGridViewCellStyle
(), true));
System\Windows\Forms\DataGridViewTests.cs (21)
794
yield return new object[] { new
DataGridViewCellStyle
() };
795
yield return new object[] { new
DataGridViewCellStyle
{ BackColor = Color.Empty } };
796
yield return new object[] { new
DataGridViewCellStyle
{ ForeColor = Color.Empty } };
797
yield return new object[] { new
DataGridViewCellStyle
{ SelectionBackColor = Color.Empty } };
798
yield return new object[] { new
DataGridViewCellStyle
{ SelectionForeColor = Color.Empty } };
799
yield return new object[] { new
DataGridViewCellStyle
{ Font = null } };
800
yield return new object[] { new
DataGridViewCellStyle
{ Alignment = DataGridViewContentAlignment.NotSet } };
801
yield return new object[] { new
DataGridViewCellStyle
{ WrapMode = DataGridViewTriState.NotSet } };
2332
DataGridViewCellStyle defaultCellStyle =
new
()
2350
ColumnHeadersDefaultCellStyle = new
DataGridViewCellStyle
{ Font = customFont2 },
2351
RowHeadersDefaultCellStyle = new
DataGridViewCellStyle
{ Font = customFont3 }
3049
_dataGridView.AlternatingRowsDefaultCellStyle =
new
() { BackColor = Color.AliceBlue };
3053
_dataGridView.AlternatingRowsDefaultCellStyle =
new
();
3169
_dataGridView.ColumnHeadersDefaultCellStyle =
new
() { BackColor = Color.Red };
3173
_dataGridView.ColumnHeadersDefaultCellStyle =
new
();
3229
_dataGridView.DefaultCellStyle =
new
() { BackColor = Color.Red };
3233
_dataGridView.DefaultCellStyle =
new
();
3349
_dataGridView.RowHeadersDefaultCellStyle =
new
();
3353
_dataGridView.RowHeadersDefaultCellStyle =
new
();
3369
_dataGridView.RowsDefaultCellStyle =
new
() { BackColor = Color.Red };
3373
_dataGridView.RowsDefaultCellStyle =
new
();
System\Windows\Forms\DataGridViewTests.Rendering.cs (3)
117
DataGridViewCellStyle defaultCellStyle =
new
()
135
ColumnHeadersDefaultCellStyle = new
DataGridViewCellStyle
{ Font = customColumnHeaderFont },
136
RowHeadersDefaultCellStyle = new
DataGridViewCellStyle
{ Font = customRowHeaderFont },
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (42)
548
yield return new object[] { new
DataGridViewCellStyle
(), null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false, HorizontalAlignment.Left, false };
551
DataGridViewCellStyle customStyle =
new
()
559
DataGridViewCellStyle transparentStyle =
new
()
569
new
DataGridViewCellStyle
578
new
DataGridViewCellStyle
587
new
DataGridViewCellStyle
596
new
DataGridViewCellStyle
605
new
DataGridViewCellStyle
614
new
DataGridViewCellStyle
624
new
DataGridViewCellStyle
633
new
DataGridViewCellStyle
642
new
DataGridViewCellStyle
651
new
DataGridViewCellStyle
660
new
DataGridViewCellStyle
669
new
DataGridViewCellStyle
679
new
DataGridViewCellStyle
688
new
DataGridViewCellStyle
697
new
DataGridViewCellStyle
706
new
DataGridViewCellStyle
715
new
DataGridViewCellStyle
724
new
DataGridViewCellStyle
757
yield return new object[] { new
DataGridViewCellStyle
(), null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false, HorizontalAlignment.Left, false };
760
DataGridViewCellStyle customStyle =
new
()
768
DataGridViewCellStyle transparentStyle =
new
()
778
new
DataGridViewCellStyle
787
new
DataGridViewCellStyle
796
new
DataGridViewCellStyle
805
new
DataGridViewCellStyle
814
new
DataGridViewCellStyle
823
new
DataGridViewCellStyle
833
new
DataGridViewCellStyle
842
new
DataGridViewCellStyle
851
new
DataGridViewCellStyle
860
new
DataGridViewCellStyle
869
new
DataGridViewCellStyle
878
new
DataGridViewCellStyle
888
new
DataGridViewCellStyle
897
new
DataGridViewCellStyle
906
new
DataGridViewCellStyle
915
new
DataGridViewCellStyle
924
new
DataGridViewCellStyle
933
new
DataGridViewCellStyle
WinFormsControlsTest (2)
DataGridViewTest.Designer.cs (2)
34
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 =
new
();
35
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 =
new
();