AD
Administrator
Syncfusion Team
February 14, 2006 04:29 AM UTC
Hi Hui,
By handling the CurrentCellValidating event, a cell value for a particular column can be forced to be not null. Below is a code snippet.
private void gridDataBoundGrid1_CurrentCellValidating(object sender, System.ComponentModel.CancelEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(cc.Renderer.ColIndex == 2 && (cc.Renderer.ControlText.Trim() == "" || cc.Renderer.ControlText == null))
{
MessageBox.Show("Cell Value cannot be empty!","Error!",MessageBoxButtons.OK,MessageBoxIcon.Stop);
e.Cancel = true;
}
}
Regards,
Calvin.