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

WrapCellBehaviour destinguishing between tab/enter and arrows

Thread ID:





34051 Aug 31,2005 09:32 PM UTC Dec 19,2005 07:32 AM UTC WinForms 3
Tags: GridControl
Sue Harris
Asked On August 31, 2005 09:32 PM UTC

I would like my grid to wrap rows when at the end of a row if the user presses tab or enter, but if I set my grids WrapCellBehaviour to WrapRow it also wraps if I use the left/right arrow keys. Is there a way to wrap rows for tab and enter but not for the arrow keys? Thanks, Sue

Administrator [Syncfusion]
Replied On August 31, 2005 10:14 PM UTC

You can try handling CurrentCellKeyDown and ignore the right arrow there if you are on the last cell.
private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e)
	if(e.KeyCode == Keys.Right && this.gridControl1.CurrentCell.ColIndex == this.gridControl1.ColCount)
		e.Handled = true;

Catinat Velmourougan
Replied On December 19, 2005 06:37 AM UTC

hi, If I am the last column and the user presses right arrow key,I dont want it to go the first column.How to prevent this? Should I use the above code or is there a property? regards, catinat

Administrator [Syncfusion]
Replied On December 19, 2005 07:32 AM UTC

Hi Catinat, For a GridControl if the WrapCellBehavior is set to WrapRow then the currentCell moves from rows to rows with tab or right key when at the end of the column. If the WrapCellBehavior is set to None which, is by default then the movement of the currentcell is only within the row for the GridControl. this.gridControl1.Model.Options.WrapCellBehavior = GridWrapCellBehavior.None; Let me know if you need any more details. Regards, Stanley


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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