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

WrapCellBehavior - same row

Thread ID:

Created:

Updated:

Platform:

Replies:

77161 Oct 16,2008 11:04 PM UTC Oct 17,2008 03:20 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 16, 2008 11:04 PM UTC

Is there a way to control tabbing in a GridDataBoundGrid so that when the user is in the last column in any row and presses the Tab key, he/she is sent to the first cell in the same row?
And, similarly, if the Shift+Tab keys are pressed and they are in the first cell, they go to the last cell in the same row?

I was hoping that one of the enums for WrapCellBehavior might be something like WrapCurrentRow.

Thanks for any help on this,
Mark


Rajadurai C [Syncfusion]
Replied On October 17, 2008 11:13 AM UTC

Hi Mark,

Thanks for your interest in Syncfusion products.

Please try the following code in CurrentCellKeyDown event handler in GridDataBoundGrid to achieve this feature.



//assuming grid containing 'n' columns

GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(e.Shift == false && e.KeyCode == Keys.Tab && cc.ColIndex == n)
{
cc.MoveTo(cc.RowIndex,1,GridSetCurrentCellOptions.SetFocus);
e.Handled = true;
}
else if(e.Shift == true && e.KeyCode == Keys.Tab && cc.ColIndex == 1)
{
cc.MoveTo(cc.RowIndex,n,GridSetCurrentCellOptions.SetFocus);
e.Handled = true;
}



Regards,
Rajadurai


Administrator [Syncfusion]
Replied On October 17, 2008 03:20 PM UTC

Rajadurai,
That works great! Thanks for your help.

Mark


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

;