Demo of a Scrollable DataGrid

This DataGrid's contents are scrollable, since the height is set to a hardcoded 300px.

FAQ ID QuestionViews
181 How can I format numbers and date/times using ASP.NET? For example, I want to format a number as a currency.964,702
161 How can I convert a Recordset into an array? Also, how can I convert an array into a Recordset?238,089
115 I am using Access and getting a 80004005 error (or a [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)' error) when trying to open a connection! How can I fix this problem?233,530
83 How can I quickly sort a VBScript array? 230,033
190 How do I display data on a web page using arrays instead of Do...While...MoveNext...???...186,006
106 How can I find out if a record already exists in a database? If it doesn't, I want to add it.183,511
118 When I get a list of all files in a directory via the FileSystemObject, they aren't ordered in any reasonable way. How can I sort the files by name? Or by size? Or by date created? Or... 168,750
30 For session variables to work, must the Web visitor have cookies enabled?133,635
14 Can I send emails without using CDONTS?130,322
149 How can I remove multiple spaces between words in a string? That is, if I have: Hi    there how can I get: Hi there?129,557

Source Code
<% @Import Namespace="System.Data" %>
<% @Import Namespace="System.Data.SqlClient" %>

<script language="vb" runat="server">
  Sub Page_Load(sender as Object, e as EventArgs)
    If Not Page.IsPostBack then
	End If
  End Sub
  Sub BindData()
    '1. Create a connection
    Dim myConnection as New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))

    '2. Create the command object, passing in the SQL string
    Const strSQL as String = "SELECT TOP 25 FAQID, Description, ViewCount FROM tblFAQ ORDER BY ViewCount DESC"
    Dim myCommand as New SqlCommand(strSQL, myConnection)

    'Set the datagrid's datasource to the datareader and databind
    dgPopularFAQs.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
  End Sub

<div style="height:300px; width:100%; overflow:auto;">
    <asp:DataGrid runat="server" id="dgPopularFAQs"
         Font-Name="Verdana" Width="80%"
         Font-Size="11pt" HorizontalAlign="Center">
    <HeaderStyle BackColor="Navy" ForeColor="White" HorizontalAlign="Center"
                 Font-Size="14pt" Font-Bold="True" />
      <asp:BoundColumn DataField="FAQID" HeaderText="FAQ ID" 
                ItemStyle-HorizontalAlign="Center" />
      <asp:BoundColumn DataField="Description" HeaderText="Question" />
      <asp:BoundColumn DataField="ViewCount" HeaderText="Views"
                ItemStyle-HorizontalAlign="Right" />

[Return to the article]