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.

Leave cell when TableControlCurrentCellValidating event fails

Thread ID:

Created:

Updated:

Platform:

Replies:

48896 Sep 6,2006 03:06 AM Sep 6,2006 09:51 AM Windows Forms 2
loading
Tags: Grouping
jamesb
Asked On September 6, 2006 03:06 AM

Please help!

I am validating an entry in the TableControlCurrentCellValidating event.
I would like to be able to set e.Inner.Cancel = true and reset the cell value to its original value(which is easy enough) and still be able to leave the cell.

However, setting e.Inner.Cancel = true does not allow me to leave the current cell until I correct the cell value.

Administrator [Syncfusion]
Replied On September 6, 2006 06:32 AM

Hi James,

Try this code snippet to resolve this.

private void TableControlCurrentCellValidating(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;

if (cc.Renderer.ControlText == "Invalid" )
{
//To get/set the new cellvalue from cc.Renderer.ControlText:
//To get the old cellvalue from e.TableControl.Model[cc.RowIndex,cc.ColIndex ].Text
cc.Renderer.ControlText = e.TableControl.Model[cc.RowIndex,cc.ColIndex ].Text;
}
}

Let me know if this helps.
Best Regards,
Haneef

jamesb
Replied On September 6, 2006 09:51 AM

works!
thx Haneef

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.

;