Datagrid Paging Problem

lorena

Centurion
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
I have an aspx page that reads files from a folder and loads hyperlinks to those files into a datagrid. Since there are numerous files, I wanted to page the datagrid. The grid loads and has next and previous arrows at the bottom but only loads the first 40 files. Is there something else I need to do?
Here is my code:
<%@ Import Namespace="System.IO" %>
<HTML>
<HEAD>
<title>Chemical Acceptance</title>
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim dirInfo as New DirectoryInfo(Server.MapPath("/plt/Qual/ChemAcc"))
dgCA.DataSource = dirInfo.GetFiles("*.pdf")
dgCA.DataBind()
End Sub
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<asp:DataGrid runat="server" id="dgCA" Font-Name="Verdana" AlternatingItemStyle-BackColor="#eeeeee" PageSize="40" AutoGenerateColumns="False" AllowPaging="True">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Name" DataNavigateUrlFormatString="http://intranet.yourcompanyhere.com/plt/Qual/ChemAcc/{0}" DataTextField="Name"></asp:HyperLinkColumn>
</Columns>
</asp:DataGrid>
</body>
</HTML>
 
Back
Top