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

Determine when scrollbar is shown

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.

4 Replies

AD Administrator Syncfusion Team May 24, 2005 07:45 AM

Try checking this.gridGroupingControl2.TableControl.VScroll.


AD Administrator Syncfusion Team May 24, 2005 08: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.


AD Administrator Syncfusion Team May 24, 2005 08: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;
}


AD Administrator Syncfusion Team May 24, 2005 08:59 AM

That did the trick. Thanks a lot, Clay.

Loader.
Live Chat Icon For mobile
Up arrow icon