How can I bind an array to a gridview with hyperlinks?

J

jm

Hi, I have this and it works (I get output in my gridview):

string[] filePaths = Directory.GetFiles(@"C:\mydirectory\", "*.pdf",
SearchOption.AllDirectories);
GridView1.DataSource = filePaths;
GridView1.DataBind();

but I don't know how to turn these into links in my gridview. I tried
a TemplateField and RowDataBound but have no idea what to put there.
If it were a database I would just use the NavigateUrl='<%#
Eval("mycolumn") %>' in the GridView, but I don't have that here.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top