Thursday, 18 October 2012

add LinkColumn in DataGrid in windows c#.net

 dataGridView1.ColumnCount = 2;
            dataGridView1.Columns[0].Name = "EID";
            dataGridView1.Columns[1].Name = "NAME";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string[] r = new string[] { dt.Rows[i].ItemArray[0].ToString(), dt.Rows[i].ItemArray[1].ToString() };
                dataGridView1.Rows.Add(r);
            }
            DataGridViewLinkColumn dgl = new DataGridViewLinkColumn();
            dgl.HeaderText = "Update";
            dgl.Text = "Edit";
            dgl.UseColumnTextForLinkValue = true;
            dataGridView1.Columns.Add(dgl);

No comments:

Post a Comment