Here is my code: Private Sub Swipe Accumulative Hours Data Grid View_Cell Validating(By Val sender As Object, By Val e As System. Cell Validating If Swipe Accumulative Hours Data Grid View. So this has been an extremely intense learning curve because I've been a cobol/structured programming programmer. I only have 1 month left to show some results because they do not understand the learning curve for this (I mentioned an IT manager with no knowledge of this - who can't understand why this isn't as fast and easy as using excel)So I'm not sure getting the book to understand this will help me in my timeframe at the moment. I was hired by a company as and analyst programmer. Show("Amount - Must enter a numeric field", "", Message Box Buttons. However,the validation message is ugly, and you can use the Data Error event to put in your user friendly error message. You probably just want to test this on one of a few columns, so you need to examine e. I just did a search for e.index and didn't find to much explaining it. In my database my 1st field is defined as decimal and the date is defined as datetime. If you do this, it will take care of the validation warnings for you. Index refers to the index of the current column which is being validated. You can sometimes get away with less code and overhead when you create your own code as opposed to what the GUI creates for you as well.
Although I would like to understand this better than I do. If the value must be numeric, is it possible for you to set the Data Type of the column of your data source to a numeric data type? Until you're familiar with all of the intricacies of ADO. Net book and practice creating your connections, datasets, dataadapters, commands, etc. It makes a lot more sense when you can see and create what's going on behind the scenes. Data Property Name = "" End Try End If End Sub Thanks Kim Sorry I meant that the error is the error message that is in the message box. While debugging, it is helpful to see the actual error message. Anyways, it looks like you are working with Data Property Name, but it sounds like you really wanted to validate the value of the cell. I'm assuming you're creating your strongly typed datasets and table adapters with the GUI and kind of creating a RAD database program.We are going through the following C# code to analyze the process of validating data in grid cell.
The C# code snippet will enable the data cell validation in a textbox column for entering only none empty strings, which will disable the data validation and display the error indicator at the row header.
In that case, have a server-side validation logic that validates the data, saves it to the database, and then sends the validated data back to the Data Grid.