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
Post a Comment