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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add row on key press

Thread ID:

Created:

Updated:

Platform:

Replies:

21214 Nov 4,2004 02:04 PM UTC Nov 4,2004 03:06 PM UTC WinForms 1
loading
Tags: GridControl
Kewalramani Kanchan
Asked On November 4, 2004 02:04 PM UTC

We are trying to provide a feature to add a new row by hitting the Tab or F9 key by trapping the Key down event. This event doesn’t get trigged when the user is editing a value on a particular column. Is there a way we can implement this ? Note: We are trying to avoid using the Key press event of the column as they would be triggered for all the every key which might affect the performance of the application. Also, there is a constraint in the application that data in all the previous row should be entered before adding the new row.

Administrator [Syncfusion]
Replied On November 4, 2004 03:06 PM UTC

You can derive the grid and override ProcessCmdKey to catch these keys and add a row.
public class MyGridDataBoundGrid : GridDataBoundGrid
{
	protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
	{
		if((0 != (keyData & Keys.Tab)) || (0 != (keyData & Keys.F9)))
		{
			  this.Binder.AddNew();
			 return true; //ignore the key
		}
		return base.ProcessCmdKey (ref msg, keyData);
	}
}

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

;