Solved

Open folder in Datagridview link

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

22 Experts available now in Live!

Get 1:1 Help Now