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.
Unfortunately, activation email could not send to your email. Please try again.

WrapCellBehaviour destinguishing between tab/enter and arrows

Thread ID:

Created:

Updated:

Platform:

Replies:

34051 Aug 31,2005 05:32 PM Dec 19,2005 02:32 AM Windows Forms 3
loading
Tags: GridControl
Sue Harris
Asked On August 31, 2005 05:32 PM

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 06:14 PM

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 01:37 AM

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 02:32 AM

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

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.

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.

;