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

Determine when scrollbar is shown

Thread ID:

Created:

Updated:

Platform:

Replies:

29357 May 24,2005 11:22 AM UTC May 24,2005 01:59 PM UTC WinForms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 24, 2005 11:22 AM UTC

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 12:45 PM UTC

Try checking this.gridGroupingControl2.TableControl.VScroll.

Administrator [Syncfusion]
Replied On May 24, 2005 01:21 PM UTC

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 01:51 PM UTC

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 01:59 PM UTC

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.

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

;