This documentation is archived and is not being maintained.

DataGridView.ScrollBars Property

Gets or sets the type of scroll bars to display for the DataGridView control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

public ScrollBars ScrollBars { get; set; }
/** @property */
public ScrollBars get_ScrollBars ()

/** @property */
public void set_ScrollBars (ScrollBars value)

public function get ScrollBars () : ScrollBars

public function set ScrollBars (value : ScrollBars)

Not applicable.

Property Value

One of the ScrollBars values. The default is Both.

Exception typeCondition


The specified value when setting this property is not a valid ScrollBars value.


The value of this property cannot be set because the DataGridView is unable to scroll due to a cell change that cannot be committed or canceled.

Regardless of the value of this property, scroll bars are shown only when they are needed. Use this property to prevent scroll bars from appearing. This is useful, for example, when you want to provide an alternative user interface (UI) for scrolling.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0