Solved

Open files with double click c#

Posted on 2009-05-14
5
705 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unlocking a column in excel using C# 17 33
How to escape alias names for Oracle query 1 41
array not updating 8 42
Connect Gridview column to Textbox in C# 2 54
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

732 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