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:
Other People Are Reading
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.
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."
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.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for