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

Setting the selected row

I have a grid with 2 rows and 5 columns. In column 2 and 4 the cell are enabled, so that the user can enter a value. I'd like to be able to set the selected row, so that when the user hits the 'Enter' key at position 1,4 the next selected row is 2,2... Getting from 1,2 to 1,4 is no problem - I've set the EnterKeyBehavior to Right. I've tried using the Move-method of CurrentCell, but I can't get it to work.

3 Replies

AD Administrator Syncfusion Team September 30, 2002 08:45 AM

In the version 1.1.0.0 Essential Grid, there is a property setting that gets you this behavior if your right-most column is enabled. That setting is this.gridControl1.Model.Options.WrapCell = true; But in your case, it appears that your right-most column is disabled. So, setting the above property will not get you the desired behavior. Instead you will have to handle this process yourself. In the attached project, there is a derived grid that implements this process.


AD Administrator Syncfusion Team October 1, 2002 07:35 AM

Perfect... almost :) If I set the ActiveCurrentCellBehaviour-property to SelectAll then the next selected cell always becomes the one i column 2 (ie. it work fine, when jumping from column 4 to 2, but not from column 2 to 4...) Besides that! Simply perfect!


AD Administrator Syncfusion Team October 2, 2002 04:37 AM

Try this. 1) Comment out the ProcessKeyPreview override. 2) In the MoveToNextCell override, there is an if-statement that starts if(!b1). Add an else clause as here:
if(!b1)
{
.....
}
else
{
	this.CurrentCell.MoveTo(row, col, 
		GridSetCurrentCellOptions.ScrollInView);
	b = true;
}

Loader.
Live Chat Icon For mobile
Up arrow icon