如何在数据网格中按链接并转到另一种形式?
代码:
foreach (DataRow item in ds.Tables["timeentryrangedetails"].Rows)
{
DataGridViewLinkColumn link = new DataGridViewLinkColumn();
dataGridView1.Columns.Add(link);
int n = dataGridView1.Rows.Add();
link.Text = "Details";
link.UseColumnTextForLinkValue = true;
dataGridView1.Rows[n].Cells[0].Value = link.Text;
dataGridView1.Rows[n].Cells[1].Value = item["CutoffID"].ToString();
dataGridView1.Rows[n].Cells[2].Value = item["StartDate"].ToString();
dataGridView1.Rows[n].Cells[3].Value = item["EndDate"].ToString();
dataGridView1.Rows[n].Cells[4].Value = item["withTax"].ToString();
dataGridView1.Rows[n].Cells[5].Value = item["SSS"].ToString();
dataGridView1.Rows[n].Cells[6].Value = item["PhilHealth"].ToString();
dataGridView1.Rows[n].Cells[7].Value = item["Pagibig"].ToString();
dataGridView1.Rows[n].Cells[8].Value = item["status"].ToString();
}