I have Tested this Sample and its running according to your requirement but in IE its getting download if i cick on the name of file.
HTML:
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvDemo2" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="FileId" HeaderText="Id" ItemStyle-Width="100" />
<asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="100" />
<asp:TemplateField HeaderText="List of Files">
<ItemTemplate>
<asp:HyperLink ID="Hyp1" Target="_blank" runat="server" Width="100px" Text='<%#Eval("Name")%>'
NavigateUrl='<%#Eval("Path")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
C#:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.PopulateGrid2();
}
}
private void PopulateGrid2()
{
DataTable dt2 = new DataTable();
dt2.Columns.AddRange(new DataColumn[3]{
new DataColumn("FileId", typeof(int)),
new DataColumn("Name", typeof(string)),
new DataColumn("Path", typeof(string))});
dt2.Rows.Add(1, "Jake", "Files/Doc1.pdf");
this.gvDemo2.DataSource = dt2;
this.gvDemo2.DataBind();
}
Which browser you are using.