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.
Syncfusion Feedback

GGC validation

Thread ID:

Created:

Updated:

Platform:

Replies:

57380 Mar 2,2007 10:11 AM Mar 2,2007 05:37 PM Windows Forms 1
loading
Tags: GridControl
Srdjan
Asked On March 2, 2007 10:11 AM

Hi.

I'm using event CurrentRecordContextChange to save data in my table.

Before saving data I want to check if all not null columns have some value inserted. If one or more not null columns are empty user should get message box with an error and option to go back and insert empty values or to undo all changes in current record.

GGC uses DataTable properties to determine not null columns.

I would appreciate sample of this behavior or a code snippet.

Thanks in advance.

Administrator [Syncfusion]
Replied On March 2, 2007 05:37 PM

Hi Srdjan,

You can try the below code snippet and let me know if this helps.

private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if( e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditCalled)
{
try
{
DataRowView dr = e.Record.GetData() as DataRowView;
if( dr.Row != null)
dr.Row.EndEdit();
}
catch(Exception ex)
{
DialogResult result = MessageBox.Show(ex.Message,"SaveRecord",MessageBoxButtons.OKCancel );
e.Cancel = true;
if( result == DialogResult.OK )
e.Table.CurrentRecord.CancelEdit();
}
}
}

Best regards,
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.

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

;