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. Image for the cookie policy date
close icon

Enter pressed in cell

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

1 Reply

AD Administrator Syncfusion Team 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;
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon