Cell Validating event lets you cancel changes to the current cell when the new value is not valid. Formatted Value property to determine the current value.To determine the state of the current cell, use the Data Grid View Cell Validating Event Args. When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source. In the previous section we saw how to import Microsoft Excel 12.0 Object Library in the C# project .Create Excel file from CSharp Data Validation Input Messages is using to embed a message in cells in an Excel Spread Sheet.When we select that cell the message will display .It is very useful for data entry purpose for define the rules for entering data and also we can put a notes about the data in the cell.Abstract: Data Grid View control is a Windows Forms control that gives you the ability to customize and edit tabular data.
If you play around with the Data Grid in Silverlight and try some scenarios, maybe you come around the Format Exception with the Message “Input String is not in a correct format”. has a Property of type int and the user enters some characters in the Data Grid.On the next step select Customer ID, Company Name, Contact Name and Country columns (Figure 2).Click on the "Advanced" button and check the "Generate INSERT, UPDATE and DELETE statements" checkbox (Figure 3). Now that you have configured the SQL Data Source control let's bind it with a Grid View control. Open its smart tag and configure it as shown in Figure 4.So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. I would rather use a generic function that would be passed each control on the form and based on the type of the control, separate validation logic would be written.in case extra validation like restricting validation to some of the controls only, that would be decided at the function calling level.