如何在vb.net中链接datagridview colomon [英] how to link datagridview colomon in vb.net

查看:115
本文介绍了如何在vb.net中链接datagridview colomon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试制作简单的文档上传和检索应用程序。我上传并将路径存储在数据库中。我的问题是我将存储在数据库中的所有信息检索到datagridview。和文档路径,但是当我点击datagridview的文件路径colomon中的链接时我无法打开文件.....

这里是我的代码,将datagridview documentpath列作为链接​​。



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.

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







请帮助我,对不起我的英语



i我正在使用vb.net 2010和ms-sql 2005




pls help me, and sorry for my english

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

推荐答案

你需要添加一个单元格内容的处理程序单击了事件。如果该列是您的链接列,则获取文档路径示例:(C:\ mydoc.txt)检查该给定路径上是否存在文件以避免错误,然后通过该特定文件类型所需的任何方式打开。



虽然我完全理解你的问题,但我不确定。如果你提供更多细节,那么它可能会变得更加清晰。
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.


这篇关于如何在vb.net中链接datagridview colomon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆