I have a code that works perfectly fine. I had run it a number of times and its working properly the whole time. But after I restarted my computer, there seem to have been an error.
The thing is... I created validations in a cell of a DataGridView. It will show an error text if it's empty, if it's non-numeric, and if there is a repetition on my primary key.
The problem is, after displaying the error text on invalid data, it won't disappear even the data reentered is valid.
It was solved before as I set the .ErrorText to "".
But the next time I ran it, it wouldn't work.
I have 4 datagridview that uses the same code but only one of the 4 is not working properly.
my code goes like this...
Try If ValidateLivingDataType() = True Then AssureLivingHasError = False grid_LivingBenefits.CurrentCell.ErrorText = "" If grid_LivingBenefits.Columns(ColumnIndex).Name = "End of Policy Year" Then If ValidateLivingPrimaryKey() = False Then AssureLivingHasError = True grid_LivingBenefits.CurrentCell.ErrorText = "There should be NO DUPLICATE VALUES in the column, 'End of Policy Year'." End If Else AddValuesInLivingTable() End If Else AssureLivingHasError = True grid_LivingBenefits.CurrentCell.ErrorText = "Insert a Numeric Input." End If Catch ex As Exception AssureLivingHasError = True grid_LivingBenefits.CurrentCell.ErrorText = "Insert a Numeric Input." End Try
Another odd thing is... although the columns 2,3,4,6 uses the same condition and statement, column 6 is the only one working.
This post has been edited by modi123_1: 12 February 2011 - 12:13 PM
Reason for edit:: please use code tags