DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; dataGridView1.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; dataGridView1.Columns.Add(Deletelink);
Create a UserControl having Edit and delete link as per your requirement. And then you can use the same code as in the following link http://social.msdn.microsoft.com/forums/en-US/winformsdesigner/thread/c28399bb-9d50-4a1e-b671-3dbaebb5cc69/ Or you can host that UserControl in your datagridview http://msdn.microsoft.com/en-us/library/7tas5c80.aspx Hopefully these links should help.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)