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.
Unfortunately, activation email could not send to your email. Please try again.

validation: Required cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

101156 Sep 29,2011 12:39 PM Sep 30,2011 01:59 AM Windows Forms 1
loading
Tags: GridControl
ram
Asked On September 29, 2011 12:39 PM

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.

Thanks,
Ram


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

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")
{
//code
}

// Grid_CurrentCellValidating
}



Please refer to our UG link.

http://help.syncfusion.com/ug_93/User%20Interface/Windows%20Forms/Grid/Documents/5334howtovalidatechangesmadetoagridcell.htm

Hope this helpful for your reference.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GridValidation.doc1031007410.zip

Please let me know if you have further concerns.

Regards,
Ragamathullah B.


CONFIRMATION

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.

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.

;