.net - Create an event for a DataGridViewButtonCell in VB.Net -


i have datagridviewbuttoncolumn, need respond when clicked can execute code. can help?

if want use datagridviewcellcontentclick event. , execute logic if button cell clicked. following code snippet should give idea.

private void datagridview1_cellcontentclick(object sender, datagridviewcelleventargs e) { // find out column clicked if (datagridview1.columns[e.columnindex] == column1) {  //get value want display  string customer = (string) datagridview1.rows[e.rowindex].cells[2].value;   // display on new form.  form form2 = new form();  form2.text = customer;  form2.showdialog();   } } 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -