We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

validation: Required cell value

Thread ID:





101156 Sep 29,2011 04:39 PM UTC Sep 30,2011 05:59 AM UTC WinForms 1
Tags: GridControl
Asked On September 29, 2011 04:39 PM UTC

Is there a way we can specify validation on Grid Cell to make it required. (whether it is a string, datetime, currency etc)

Appreciate response.


Ragamathulla B [Syncfusion]
Replied On September 30, 2011 05:59 AM UTC

Hi Ram.

Thank you for your interest in Syncfusion products.

You can be used to validate the changes that are made to a grid cell: CurrentCellValidateString and CurrentCellValidating. The CurrentCellValidateString is fired every time a key is pressed and the current text is passed as part of the EventArgs. The CurrentCellValidating is only fired once when the user tries to leave the current cell.

private void grid_CurrentCellValidating(object sender, CancelEventArgs e)
GridCurrentCell cc = this.grid.CurrentCell;

// Prevent user from blanking out cells in column 2.
if (cc.ColIndex == 2)
string val = cc.Renderer.ControlText;
if (val.Length == 0)

// No empty string in col 2.
e.Cancel = true;
if (cc.Renderer.StyleInfo.CellType == "DateTime")

// Grid_CurrentCellValidating

Please refer to our UG link.


Hope this helpful for your reference.


Please let me know if you have further concerns.

Ragamathullah B.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon