简体   繁体   English

如何按下datagridview1中的链接并转到另一表格?

[英]How to press the link in the datagridview1 and go to the another form?

How to press the link in the datagrid and go to the another form? 如何按数据网格中的链接并转到另一种形式?

在此处输入图片说明

Code: 码:

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();
        }

you can use the DataGridViewLinkColumn. 您可以使用DataGridViewLinkColumn。

For more information read it 有关更多信息, 请阅读

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM