Solved

Open folder in Datagridview link

Posted on 2011-09-06
4
487 Views
Last Modified: 2012-05-12
I have a column call "Open". I want to add a link to open a folder. How can this be done?
ee.JPG
0
Comment
Question by:VBdotnet2005
  • 2
4 Comments
 
LVL 5

Expert Comment

by:gingermoleman
ID: 36495668
Hi,

Where does the folder exist? If its on the server then I dont beleive you can unless this is an intranet (not without it being more about domain permissions anyway).
Have you though of using an upload/ download component to display the folder contents back?
Its easy enough to list the contents of a folder back as a list and make them all hyperlinks to the files if your looking for a zero cost solution.

If you can explain a bit better what it is your trying to acheive I'll find a better answer for you.

GMM
0
 

Author Comment

by:VBdotnet2005
ID: 36496712
Please see attachment. Thank you for your help
ee.JPG
0
 
LVL 5

Expert Comment

by:gingermoleman
ID: 36496920
Hi,

Very sorry, I saw datagrid and pressumed this was a webpage related question! Im not sure if I can help but I'll try.

You seem to have resolves the dl.text problem, and your syntax for opening explorer is correct.
I think its useColumnTextforLinkValue which is wrong in that the value it brings is just dept1. Can you put the full path into the db?
Otherwise, you'll need to ammend the value somehow to prefix the C:\Documents etc bit.

GMM
0
 
LVL 13

Accepted Solution

by:
gamarrojgq earned 500 total points
ID: 36497535
Hi,

You have to use the CellContentClick Event of your datagridview and inside that event you call the Process.Start method like this

    Private Sub DataGridView1_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

        Process.Start("explorer.exe", DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString)

    End Sub


This will open the Explorer and look for the folder Dept1 or Dept2 according to your example before.

Hope that helps
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now