ComponentOne Grid for WPF: Grid for WPF Task-Based Help > Customizing the Grid's Appearance > Hiding Grid Scrollbars

Hiding Grid Scrollbars

You can disable users from scrolling the grid at run time by hiding the horizontal and or vertical scrollbars. By default the HorizontalScrollbarPlacement property is set to Bottom and the VerticalScrollbarPlacement property is set to Right and the grid can be scrolled. By setting the HorizontalScrollbarPlacement and VerticalScrollbarPlacement properties to None, scrollbars will not be visible and you will prevent users from scrolling the grid.

In XAML

Prevent users from scrolling the grid at run time by adding HorizontalScrollbarPlacement="None" VerticalScrollbarPlacement="None" to the <c1grid:C1DataGrid> tag so that it looks similar to the following:

<c1grid:C1DataGrid Name="C1DataGrid1" HorizontalScrollbarPlacement="None" VerticalScrollbarPlacement="None"/>

In Code

Prevent users from scrolling the grid at run time by adding the following code to your project:

      Visual Basic

C1DataGrid1.HorizontalScrollbarPlacement = HorizontalScrollbarPlacement.None

C1DataGrid1.VerticalScrollbarPlacement = VerticalScrollbarPlacement.None

      C#

c1DataGrid1.HorizontalScrollbarPlacement = HorizontalScrollbarPlacement.None;

c1DataGrid1.VerticalScrollbarPlacement = VerticalScrollbarPlacement.None;


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.