Hyperlinks in DataGrid

lorena

Centurion
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
I have a datagrid that binds (successfully) to a list of files in a virtual directory. I have set up the grid to hyperlink to the files so users can click on them and open the files - that part doesn't work. I tried setting the "NavigateURL" to the virtual directory but the hyperlink doesn't change.
Here is my code:
<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("/p1/Quality/Acceptance_Recs/ChemAcc"))
dgCA.DataSource = dirInfo.GetFiles("*.pdf")
dgCA.DataBind()
End Sub
</script>
<link href="http://intranet.talleyds.com/viper/styles/tocDOC.css" type="text/css" rel="stylesheet">
</HEAD>
<body MS_POSITIONING="GridLayout">
<%
Response.WriteFile ("../includes/qHeader.asp")
%>
<table cellPadding="5" width="300" border="1">
<tr>
<th align="center">Acceptance Records</th>
</tr>
</table>
<p />
<asp:DataGrid runat="server" id="dgCA">
<HeaderStyle Font-Size="15pt" Font-Bold="True" ForeColor="White" BackColor="Navy" />
<Columns>
<asp:HyperLinkColumn NavigateUrl="http://intranet.fred.com/v1/Acceptance/" DataTextField="Name" DataNavigateUrlField="Name" DataTextField="Name" HeaderText="File Name" />
</Columns>
</asp:DataGrid></p>
</body>
The "NavigateURL" doesn't appear if I mouseover the link, instead it shows the current website and folder location.
Any help would be appreciated. Thanks
 
Back
Top