Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HyperLinkColumn
Message
From
17/10/2007 07:25:11
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
HyperLinkColumn
Miscellaneous
Thread ID:
01261432
Message ID:
01261432
Views:
45
Hi all,

I'm using a DataGrid to display a list of Excel files that I have on my C drive. I use HyperLinkColumn as one of my columns to display the files found.

My problem is that I need to be able to click on the hyperlink and open the Excel file, but for some reason this doesn't work.

I have been looking at this for two days and still can't see why.

Can some please help me...

Is it possible to have a column HyperLinkColumn from a DataGrid to open an Excel file and if so what am I doing wrong.

My code::
< %@ Page Language="VB" Debug="true" EnableViewState="False" % >
< %@ Import Namespace="System.Data" % >
< %@ Import Namespace="System.IO" % >
< %@ Import Namespace="system.xml" % >

<script language="VB" runat="server">

	Sub Page_Load(sender as Object, e as EventArgs)
        Dim strPath As String = "C:\"
        Dim myDirInfo As DirectoryInfo

        myDirInfo = New DirectoryInfo(strPath)
        dgFileList1.DataSource = myDirInfo.GetFiles("Hebdo.xls")
        dgFileList1.DataBind()

    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Caddie BiReports</title>
</head>
<body bgcolor="aliceblue">
<form id="Form1" runat="server">

    <asp:DataGrid id="dgFileList1" runat="server"
      Width                 = "98%"
  	  Border                = "0"
	  BorderColor           = "Blue"
	  CellSpacing           = "0"
	  CellPadding           = "2"
          HeaderStyle-Font-Bold = "True"
          AutoGenerateColumns   = "False"
	  AllowSorting        = "True">
 	  <Columns>
  	<asp:HyperLinkColumn DataNavigateUrlField="FullName" DataTextField="Name" HeaderText="Report Name:" />
	  </Columns>
      <ItemStyle BackColor="AliceBlue" />
      <HeaderStyle BackColor="Desktop" Font-Bold="True" ForeColor="White" />
    </asp:DataGrid>

</form>
</body>
</html>
Thank you for any help or info
Next
Reply
Map
View

Click here to load this message in the networking platform