Solved

Open files with double click c#

Posted on 2009-05-14
5
706 Views
Last Modified: 2012-05-07
Hi
Have created a grid of rows of various files names all with different extensions eg/ jpg doc xls

I want to emulate what happens in windows exploers when a user double clicks on the file it opens the file (the row does have the full payh of the file) in the application that windows stores that relates to that extension

Thanks

Rgds
Stephen
0
Comment
Question by:stephenwilde
[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
5 Comments
 
LVL 9

Accepted Solution

by:
tculler earned 300 total points
ID: 24390263
Calling System.Diagnostics.Process.Start(NameOfFile); will "run" the file using the default program. For example, calling this method on a directory (i.e. System.Diagnostics.Process.Start("C:\\");) will bring up that directory in Windows Explorer. The same goes for pictures and such--the file will just run in the default "associated" application.
0
 
LVL 30

Assisted Solution

by:anarki_jimbel
anarki_jimbel earned 100 total points
ID: 24391284
0
 

Author Comment

by:stephenwilde
ID: 24392501
Thanks - the solution worked perfectly in a quick code sample on hard coded data

But I need to have the functunality as a hyperlink on a cell in a  grid - any ideas on how to implement that useage

Rgds
Stephen
0
 
LVL 1

Assisted Solution

by:secutos
secutos earned 100 total points
ID: 24403426
You can use the grid's event handler OnClick() and detect which item was clicked and respond approprietly.
0
 

Author Closing Comment

by:stephenwilde
ID: 31581716
Thankyou
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

719 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