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 - Keep user from selecting new row until current active cell is validated

Thread ID:

Created:

Updated:

Platform:

Replies:

33296 Aug 17,2005 01:34 PM UTC Aug 17,2005 06:07 PM UTC Windows Forms 1
loading
Tags: GridControl
Brian Corley
Asked On August 17, 2005 01:34 PM UTC

Is there a way to keep the user from selecting a new row in the GGC when they are currently editing a cell and you need to validate that cell and if it is invalid have the row that contained the current cell keep focus. I currently have the following settings: this.grid.TableOptions.AllowSelection = GridSelectionFlags.None; this.grid.TableOptions.ListBoxSelectionMode = SelectionMode.One;

Administrator [Syncfusion]
Replied On August 17, 2005 06:07 PM UTC

To do record level validation, you can use the CurrentRecordContextChanged event. Here is code that will not let you leave a record if Col1 has a 1 in it.
private void gridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{
	if(e.Action == CurrentRecordAction.LeaveRecordCalled)
	{
		GridRecord record = e.Record as GridRecord;
		if(record != null && record.GetValue("Col1").Equals("1"))
		{
			e.Cancel = true;
		}
	}
}

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

;