c# - Right click on datagridview and call edit form to edit selected row -


i have combobox , textbox filter data , show them in datagridview:

    afdbentities adbe = new afdbentities();      private void btnsearch_click(object sender, eventargs e)     {          var cbo = cmbinstallers.text;         switch (cbo){             case "first name":                 var ianst = (from x in adbe.tblinstallers                          x.firstname.contains(txtsearch.text)                          select x).tolist();                 dgvsearched.datasource = ianst;     } 

and when have example 4 results contains "x", shown in datagridview. want make right click option on datagridview gives me menu opening new form edit selected row of results.

picture of form

you need assign context menu datagridview , monitor events through editing_control_showing event handle on datagridview.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -