Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i try to make simple document upload and retrieval application. and i do uploading and store the path in database. my problem is i retrieve all information stored in database to datagridview. and the document path, but i cant open the file when i click the link in document path colomon of datagridview .....
here is my code to make datagridview documentpath column as link.

VB
Dim dl As New DataGridViewLinkColumn()
            dl.DataPropertyName = "DocPath"
            dl.Name = "Download"
            DataGridView1.Columns.Add(dl)



pls help me, and sorry for my english

i am using vb.net 2010 and ms-sql 2005
Posted

1 solution

You will need to add a handler for the cell content clicked Event. If the column is your Link column then get the document path example: (C:\mydoc.txt) Check for the existence of the file at that given path to avoid errors and then open by whatever means are required for that particular file type.

I'm not certain though that I fully understand your question. If you provide more details then maybe it will become a little more clear.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900