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

Leaving edit mode when you can''t wrap

I''ve got a grid where I''ve set the WrapCellBehaviour to None, and the ActivateCurrentCellBehavior to None. When I finish editing a cell and hit enter, it goes out of edit mode and moves to the next column (as expected). However when in the last column, since it can''t go to the next column, it goes straight back into edit mode - looking to the user as if the changes haven''t been applied. I want the grid to leave edit mode (as if the grid cell had just been moved to). Whats the best way to get this behaviour? Thanks, Sue

1 Reply

AD Administrator Syncfusion Team September 6, 2005 07:58 AM UTC

You can do this in QueryNextCurrentCellPosition.
private void gridControl1_QueryNextCurrentCellPosition(object sender, GridQueryNextCurrentCellPositionEventArgs e)
{
	if(e.ColIndex > this.gridControl1.ColCount)
	{
		this.gridControl1.CurrentCell.EndEdit();
		if(this.gridControl1.CurrentCell.Renderer.Control != null 
			&& this.gridControl1.CurrentCell.Renderer.Control.Visible)
		{
			this.gridControl1.CurrentCell.Renderer.Control.Hide();
		}
		e.Handled = true;
		e.Result = false;
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon