0
我有在它3個環節一個DataGridView,我希望能夠點擊的鏈接,並把它打開,我也利用這個的DataGridView multilpe鏈接
private void Dgv_View_Employees_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
DataGridViewRow row = this.Dgv_View_Employees.Rows[e.RowIndex];
string filenametodisplay = row.Cells[8].Value.ToString();
string targetPath = @"C:\root";
string open = System.IO.Path.Combine(targetPath + filenametodisplay);
System.Diagnostics.Process.Start(open);
}
}
,它工作正常,如果有隻有一個鏈接,問題是,它似乎打開第一個鏈接並忽略其餘部分,我需要更改哪些鏈接才能打開正確單元格中的鏈接?
是否有3個單元,在每個小區的鏈路,或者是否有一個細胞三通?你使用什麼類型的datagridviewcell?你試過什麼了? –
它是3個單元格,每個都有一個鏈接,我使用DataGridViewLinkColumns,並用DataGridViewTextBoxColumns嘗試它,它們打開鏈接,但它們只打開第一個鏈接,無論我點擊哪一個鏈接,我都試圖將特定單元格分配給用if()語句將其與某種數字範圍進行比較的想法是可變的,但我沒有取得任何成功 – Christiaan