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.

Determine when scrollbar is shown

Thread ID:

Created:

Updated:

Platform:

Replies:

29357 May 24,2005 07:22 AM May 24,2005 09:59 AM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 24, 2005 07:22 AM

Is there a way I can determine when the vertical scrollbar of the grouping grid is shown/hidden? I want to use this in a resize-to-fit feature. For example, if the user expands a group or adds a row, this may lead to the vertical scrollbar being shown. I want to detect this situation in order to resize the grid columns.

Administrator [Syncfusion]
Replied On May 24, 2005 08:45 AM

Try checking this.gridGroupingControl2.TableControl.VScroll.

Administrator [Syncfusion]
Replied On May 24, 2005 09:21 AM

I probably explained my problem poorly. I don''t want to disable or enable the scroll bar. I am looking for an event that I can hook into to be notified when the grid decides to show or remove the vertical scrollbar.

Administrator [Syncfusion]
Replied On May 24, 2005 09:51 AM

Try handling the this.gridGroupingControl2.TableControl.SizeChanged event. There you can use the above property to tell when the VScrollBars comes and goes.
private bool oldVScroll = false; 
private void TableControl_SizeChanged(object sender, EventArgs e)
{
	if(oldVScroll != this.gridGroupingControl2.TableControl.VScroll)
	{
		Console.WriteLine("vscrollbar: {0}", this.gridGroupingControl2.TableControl.VScroll); 
	}
	oldVScroll = this.gridGroupingControl2.TableControl.VScroll;
}

Administrator [Syncfusion]
Replied On May 24, 2005 09:59 AM

That did the trick. Thanks a lot, Clay.

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.

;