Greetings all,
I am wondering about adding a feature to my small application that will help the users simplify things.
Starter:
A portion of the program will generate a DataGridView(DGV) of Incoming and Outgoing invoices, as an end of month recap for managers. Occasionally, they want to look at the actual digital copies of the invoices, which I store on one of our network shares.
Prompt:
Is it possible to add an event to the DGV, so when a user clicks on one of the rows, it opens up a file browser that shows them the directory corresponding to that invoice reference listed in the DGV?
Problem:
Each entry in the DGV is pulled from a DB via SQL queries; so I will be putting the physical network drive link in the NOTES field of the table holding this data. I am thinking about parsing the NOTES field to retrieve the link, which will then be used in the event that triggers when the user clicks on a row in the DGV.
Thoughts? Or recommendations for a more simplistic approach that I may be overlooking?
Regards.
EDIT:
I have implemented the following as a temporary test, which seems to work in a very basic form.
private void dgEoM_Invoices_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
string folderPath = @"C:\Users\Steve Fontenot\Documents\Projects\Database _ WORKING";
if (Directory.Exists(folderPath))
{
ProcessStartInfo startInfo = new ProcessStartInfo
{
Arguments = folderPath,
FileName = "explorer.exe"
};
Process.Start(startInfo);
}
else
{
MessageBox.Show(string.Format("{0} Directory does not exist!", folderPath));
}
}
Now, I just need to figure out how to get the event to handle each row individually according to their network share link (physical network directory location).