c# - Static context menu command target -


i have following context menu on header of column in datagridview.

<datagridcheckboxcolumn binding="{binding include,updatesourcetrigger=propertychanged}"  width="50">     <datagridcheckboxcolumn.headertemplate>         <datatemplate>             <textblock text="export">                 <textblock.contextmenu>                     <contextmenu>                         <menuitem header="alle auswaehlen"/>                         <menuitem header="alle abwahelen"/>                     </contextmenu>                 </textblock.contextmenu>                   </textblock>         </datatemplate>     </datagridcheckboxcolumn.headertemplate> </datagridcheckboxcolumn> 

as can see, context menu static. how can map command attribute static methods in code? examples found online flexible binding or cut/copy.

you use click event instead:

<menuitem header="alle auswaehlen" click="menuitem_click_1"/> 

and have method in code:

private void menuitem_click_1(object sender, routedeventargs e) {  } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -