private void DgwLinks_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { try { DataRow row = ((DataTable)(DgwLinks.DataSource)).Rows[e.RowIndex]; string link = (string)row["startLink"]; Class clickedClass = db.GetClassById((int)row["idClass"]); if (link.Substring(0, 4) == "http" || link.Contains(".exe")) { Commons.ProcessStartLink(link); } else { Commons.ProcessStartLink(clickedClass.PathRestrictedApplication + "\\" + link); } } catch (Exception ex) { Console.Beep(); } } }