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

Enter pressed in cell

Thread ID:

Created:

Updated:

Platform:

Replies:

6562 Aug 18,2003 06:02 AM UTC Aug 18,2003 06:33 AM UTC WinForms 1
loading
Tags: GridControl
Enemaerke
Asked On August 18, 2003 06:02 AM UTC

I have a grid where only a couple of the cells are editable. When I press ENTER in these cells the grid automatically moves focus/currentcell to the next editable cell in the row. Is there any way I can turn off this behaviour or even better, catch the 'move' event and move focus to a celll of my choice? Sincerly Soren Enemaerke

Administrator [Syncfusion]
Replied On August 18, 2003 06:33 AM UTC

There is both a property and an event. The property is EnterKeyBehavior. Here is a setting that turns off any action by the enter key. this.gridControl1.EnterKeyBehavior = GridDirectionType.None; The event is QueryNextCurrentCellPosition. Here is code that will move you to 1,1 anytime you try to tab into cell 3,3.
private void grid_QueryNextCurrentCellPosition(object sender, GridQueryNextCurrentCellPositionEventArgs e)
{
	if(e.ColIndex == 3 && e.RowIndex == 3)
	{
		e.ColIndex = 1;
		e.RowIndex = 1;
		e.Handled = true;
		e.Result = 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

;