?
Solved

Open folder in Datagridview link

Posted on 2011-09-06
4
Medium Priority
?
531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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