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.

Setting the selected row

Thread ID:

Created:

Updated:

Platform:

Replies:

1170 Sep 30,2002 07:18 AM Oct 2,2002 04:37 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 30, 2002 07:18 AM

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.

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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!

Administrator [Syncfusion]
Replied On 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;
}

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.

;