Solved

Open folder in Datagridview link

Posted on 2011-09-06
4
503 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

803 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