How to Add Scroll Bars to Datagrid

Written by jaime avelar
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Add Scroll Bars to Datagrid
Create a Silverlight application in Visual Basic. (Binary code high-tech abstract texture series image by artcalin from

Knowing how to enable horizontal and vertical scroll bars in a data grid using Microsoft Silverlight can make your application more dynamic. Silverlight is used to build media experiences and interactive applications for the Web. A data grid control is used to display data in a tabular format similar to a database table. It's built out of columns and rows. Scroll bars allow the user to scroll to the left or right, or up or down to view data.

Skill level:


  1. 1

    Start Microsoft Visual Web Developer Express, then select "New Project" from the left pane of your screen. Expand "Visual Basic" under "Installed Templates" and select "Silverlight." Double-click "Silverlight Application" to create a new project.

  2. 2

    Leave the default settings the same in the "New Silverlight Application" dialogue box. Click "OK." Double-click "DataGrid" to add a new data grid control. Right-click the "DataGrid" control and select "Properties."

  3. 3

    Double-click "MainPage.xaml.vb" under "Solution Explorer" to open the module. Copy and paste the following code under "InitializeComponent()":

    Me.DataGrid1.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible

    Me.DataGrid1.VerticalScrollBarVisibility = ScrollBarVisibility.Visible

    The above code will add both the horizontal and vertical scroll bars to the data grid control.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.