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

Try checking this.gridGroupingControl2.TableControl.VScroll.


AD Administrator Syncfusion Team 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.


AD Administrator Syncfusion Team 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;
}


AD Administrator Syncfusion Team May 24, 2005 01:59 PM UTC

That did the trick. Thanks a lot, Clay.

Loader.
Up arrow icon