wpf - Checkbox with Catel EventToCommand not working in Datagrid -
i have following xaml:
<datagrid.columns> </datatemplate> </datagridtemplatecolumn.headertemplate> <datagridtemplatecolumn.celltemplate> <datatemplate> <checkbox ischecked="{binding isselected, mode=twoway}" command="{binding datacontext.updatecommand, relativesource={relativesource mode=self}}"> </checkbox> </datatemplate> </datagridtemplatecolumn.celltemplate> </datagridtemplatecolumn>
in viewmodels have;
public command updatecommand { get; private set; } updatecommand = new command(updatecontrols); private void updatecontrols() { //execute }
however, updatecontrols never executed. can me working ?
the problem binding (which checkbox). should give datagrid name , use binding:
<checkbox ischecked="{binding isselected, mode=twoway}" command="{binding elementname=mydatagrid, path=datacontext.updatecommand}" />
Comments
Post a Comment