Onteora Software

Ken Tucker's Blog
posts - 145, comments - 628, trackbacks - 0

DataGrid

Datagrid Validation

Datagrid Validation The DataGridView has a CellValidating Event to validate the data entered. Here is how to do it with the DataGrid. There are 2 method to do this. My method is to add a tablestyle to the datagrid. For the cells I want to validate I handle the DataGridTextBoxColumn's Textbox's Validate event. George Shepherd's method is use the CurrentCellChanged event. You can read about this method in the Windows Forms FAQ. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Text; using System.Windows.Forms; namespace CSDatagrid {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }         private void Form1_Load(object sender, EventArgs e)         {            ...

posted @ Sunday, September 16, 2007 3:05 PM | Feedback (2) | Filed Under [ C# DataGrid ]

Powered by: