Alright, so I have a datagridview that I'm populating with a datatable, and I have added a button column. Now I am trying to use this button's click event to open a new child form. I can't for the life of me figure out what I've done wrong. When I click the button absolutely nothing happens. No error, nothing in debug, help me please.
Here is what I have so far...
public partial class Project : Form
{
DataGridViewButtonColumn view;
}
public Project()
{
InitializeComponent();
...
view = new DataGridViewButtonColumn();
view.HeaderText = "View";
view.Text = "View";
view.UseColumnTextForButtonValue = true;
view.Width = 50;
dGvExisting.Columns.Add(view);
}
public void dGvExisting_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
int curRow = int.Parse(e.RowIndex.ToString());
if (dGvExisting.Columns[e.ColumnIndex] == view && curRow >= 0)
{
ViewProject newView = new ViewProject();
newView.MdiParent = Form1.ActiveForm;
newView.Show();
}
}
I simply need to gain access to the click event so that I can add some code to it.