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

ActiveCell scrolls always into view when on form with AutoScroll enabled

Thread ID:

Created:

Updated:

Platform:

Replies:

31104 Jun 30,2005 08:22 AM UTC Jun 30,2005 03:30 PM UTC WinForms 5
loading
Tags: GridControl
Christian Rattat
Asked On June 30, 2005 08:22 AM UTC

Hi, I''m using 3.0.1.0 Suite and I have the following problem: I have the grid control on a form that has AutoScroll enabled. In the upper area of the form I have some dropdowns which specify the grid''s content. Now, when a cell is active and I resize the form the active cell is always scrolled into view automatically. Can I prevent this behaviour and keep the upper area visible unless I use the scrollbars of the form to scroll to the grid cell manually? Thanks in advance, Chris

Administrator [Syncfusion]
Replied On June 30, 2005 09:15 AM UTC

This is likely a WIndows Forms behavior. You can test this by creating a project with a scrollable form and adding a TextBox to the bottom of the form. Then run the project and size the form. You will see the scrollbar adjust so that the active textbox is always visible. I do not know of a nice clean way to avoid this behavior. You can hack by doing something like put a 1x1 button at the top of your form. Then handle form.Resize and call buttun1.Focus() in the handler. This is move teh focus away from teh active control and noot require the window to scroll.

Christian Rattat
Replied On June 30, 2005 10:22 AM UTC

Thanks Clay, I should have noticed myself that this comes from the form and not from the grid. Regards, Chris

Christian Rattat
Replied On June 30, 2005 11:29 AM UTC

Hi, it seems there is another reason for the problem. I tried your solution in a sample and it works. But in my actual application I have an mdi form which uses the SyncFusion tabbed mdi manager. The form that holds the grid is an mdi child. Now, when I set the focus to the test button the focus remains on the grid. Even if I do a currentcell.deactivate and then set the focus to the button or the form (or anything else) it remains on the grid. I have attached a sample that shows the behaviour. Regards, Christian FocusTest_2.zip

Administrator [Syncfusion]
Replied On June 30, 2005 12:15 PM UTC

In your SizedChanged handler, try setting the form''s ActiveControl to be the button.
private void Form1_SizeChanged(object sender, System.EventArgs e)
{
	this.ActiveControl = this.button1;
	//this.button1.Focus();
}

Christian Rattat
Replied On June 30, 2005 03:30 PM UTC

Great! This works perfect for me. Thanks, Chris

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

;