Gridview Control download file using hyperlink from database

I using Gridview control to display some data from SQL database. One of these items is a path to a directory that holds PDF files. Rather than show the path in the Gridview I would like to display a hyperlink that will open or download the PDF file. Any help would be appreciated.

Current Page code:
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Punch_Grid.aspx.vb" Inherits="Punch_Grid" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style24 {
            width: 470px;
        .auto-style25 {
            width: 409px;
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <table class="auto-style1">
                <td class="auto-style25">&nbsp;</td>
                <td class="auto-style24">
                    <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" Text="Punch List Review"></asp:Label>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="ID" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Vertical" Width="1291px">
            <AlternatingRowStyle BackColor="#CCCCCC" />
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="TagNo" HeaderText="TagNo" SortExpression="TagNo" />
                <asp:BoundField DataField="Path" HeaderText="Path"
                    SortExpression="Path" />
                    <asp:ButtonField ButtonType="Link" Text="Download" CommandName="Download" HeaderText="Download" />

            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BlackRhinoConnectionString %>" SelectCommand="SELECT * FROM [Punch]"></asp:SqlDataSource>
Who is Participating?
guru_samiConnect With a Mentor Commented:
Here's an example of how to use Hyperlink inside of GridView.
Jitendra PatilSr.Software EngineerCommented:
try the link below.
File download from GridView rows in ASP.NET
hope this helps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.