Index: Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs =================================================================== diff -u -rd5326f028bd3c83dc0479606ea1e2e1ead914e29 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d5326f028bd3c83dc0479606ea1e2e1ead914e29) +++ Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -197,6 +197,15 @@ } /// + /// Looks up a localized string similar to De tekst mag niet leeg zijn.. + /// + public static string RoundedDoubleConverter_ConvertFrom_String_cannot_be_empty { + get { + return ResourceManager.GetString("RoundedDoubleConverter_ConvertFrom_String_cannot_be_empty", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De tekst moet een getal zijn.. /// public static string RoundedDoubleConverter_ConvertFrom_String_must_represent_number { Index: Core/Common/src/Core.Common.Base/Properties/Resources.resx =================================================================== diff -u -rd5326f028bd3c83dc0479606ea1e2e1ead914e29 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision d5326f028bd3c83dc0479606ea1e2e1ead914e29) +++ Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -171,4 +171,7 @@ 1/{0:n0} + + De tekst mag niet leeg zijn. + \ No newline at end of file Index: Core/Common/src/Core.Common.Base/TypeConverters/RoundedDoubleConverter.cs =================================================================== diff -u -r93b256575fba3e4068baadeeb62140533336371a -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/src/Core.Common.Base/TypeConverters/RoundedDoubleConverter.cs (.../RoundedDoubleConverter.cs) (revision 93b256575fba3e4068baadeeb62140533336371a) +++ Core/Common/src/Core.Common.Base/TypeConverters/RoundedDoubleConverter.cs (.../RoundedDoubleConverter.cs) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -54,6 +54,12 @@ } catch (FormatException exception) { + if (string.IsNullOrWhiteSpace(text)) + { + throw new NotSupportedException(Resources.RoundedDoubleConverter_ConvertFrom_String_cannot_be_empty, + exception); + } + throw new NotSupportedException(Resources.RoundedDoubleConverter_ConvertFrom_String_must_represent_number, exception); } Index: Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs =================================================================== diff -u -rf72f906a6875250a4378945ce814997ff8aaf1a7 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) +++ Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -68,7 +68,11 @@ DataPropertyName = dataPropertyName, HeaderText = headerText, Name = string.Format("column_{0}", dataPropertyName), - ReadOnly = readOnly + ReadOnly = readOnly, + DefaultCellStyle = + { + DataSourceNullValue = string.Empty + } }); } @@ -328,21 +332,15 @@ private void DataGridViewOnCellValidating(object sender, DataGridViewCellValidatingEventArgs e) { - dataGridView.Rows[e.RowIndex].ErrorText = String.Empty; - - var cellEditValue = e.FormattedValue.ToString(); - if (string.IsNullOrWhiteSpace(cellEditValue)) - { - dataGridView.Rows[e.RowIndex].ErrorText = Resources.DataGridViewCellValidating_Text_may_not_be_empty; - } + dataGridView.Rows[e.RowIndex].ErrorText = string.Empty; } private void DataGridViewOnDataError(object sender, DataGridViewDataErrorEventArgs e) { e.ThrowException = false; e.Cancel = true; - if (string.IsNullOrWhiteSpace(dataGridView.Rows[e.RowIndex].ErrorText) && e.Exception != null) + if (e.Exception != null) { dataGridView.Rows[e.RowIndex].ErrorText = e.Exception.Message; } Index: Core/Common/src/Core.Common.Controls/Properties/Resources.Designer.cs =================================================================== diff -u -r0d1a1a5d6962e334a56ec7fd0c83488c6f377ca3 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/src/Core.Common.Controls/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0d1a1a5d6962e334a56ec7fd0c83488c6f377ca3) +++ Core/Common/src/Core.Common.Controls/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -71,15 +71,6 @@ } /// - /// Looks up a localized string similar to De tekst mag niet leeg zijn.. - /// - public static string DataGridViewCellValidating_Text_may_not_be_empty { - get { - return ResourceManager.GetString("DataGridViewCellValidating_Text_may_not_be_empty", resourceCulture); - } - } - - /// /// Looks up a localized string similar to <geen>. /// public static string DataGridViewComboBoxItemWrapper_DisplayName_None { Index: Core/Common/src/Core.Common.Controls/Properties/Resources.resx =================================================================== diff -u -r0d1a1a5d6962e334a56ec7fd0c83488c6f377ca3 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/src/Core.Common.Controls/Properties/Resources.resx (.../Resources.resx) (revision 0d1a1a5d6962e334a56ec7fd0c83488c6f377ca3) +++ Core/Common/src/Core.Common.Controls/Properties/Resources.resx (.../Resources.resx) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -124,7 +124,4 @@ <geen> - - De tekst mag niet leeg zijn. - \ No newline at end of file Index: Core/Common/test/Core.Common.Base.Test/TypeConverters/RoundedDoubleConverterTest.cs =================================================================== diff -u -r93b256575fba3e4068baadeeb62140533336371a -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Core/Common/test/Core.Common.Base.Test/TypeConverters/RoundedDoubleConverterTest.cs (.../RoundedDoubleConverterTest.cs) (revision 93b256575fba3e4068baadeeb62140533336371a) +++ Core/Common/test/Core.Common.Base.Test/TypeConverters/RoundedDoubleConverterTest.cs (.../RoundedDoubleConverterTest.cs) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -83,6 +83,22 @@ } [Test] + public void ConvertFrom_TextIsEmpty_ThrowNotSupportedException() + { + // Setup + string text = string.Empty; + + var converter = new RoundedDoubleConverter(); + + // Call + TestDelegate call = () => converter.ConvertFrom(null, CultureInfo.CurrentCulture, text); + + // Assert + string message = Assert.Throws(call).Message; + Assert.AreEqual("De tekst mag niet leeg zijn.", message); + } + + [Test] public void ConvertFrom_TextTooLongToStoreInDouble_ThrowNotSupportedException() { // Setup Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -re1157c221217ef3b5ade6034183a7da0e620eb05 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e1157c221217ef3b5ade6034183a7da0e620eb05) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -360,15 +360,6 @@ } /// - /// Looks up a localized string similar to De tekst mag niet leeg zijn.. - /// - public static string DataGridViewCellValidating_Text_may_not_be_empty { - get { - return ResourceManager.GetString("DataGridViewCellValidating_Text_may_not_be_empty", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Het soort kansverdeling waarin deze parameter gedefinieerd wordt.. /// public static string Distribution_DestributionType_Description { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -re1157c221217ef3b5ade6034183a7da0e620eb05 -r1119ad16afc56bb523cac630e15fb98b1fcf8d25 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision e1157c221217ef3b5ade6034183a7da0e620eb05) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 1119ad16afc56bb523cac630e15fb98b1fcf8d25) @@ -244,9 +244,6 @@ Vak - - De tekst mag niet leeg zijn. - ..\Resources\blue-document--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a