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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top