Solved

Open folder in Datagridview link

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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