This question is locked. New answers and comments are not allowed.
Hello all,
I have a datagrid that lists a bunch of people and a context menu to perform some actions on those people - I'm using commands.
My context menu looks like this:
*
-Add To Policy
-Policy1
-Policy2
-Policy3
-Delete
-Open
-Blah Blah Blah
My problem is this. When adding a person to a policy, I need to pass both the datagridrowcontext (a person) and the policy (a policy) to the command via containerbindings as a CommandParameter.
1. How can I get a reference back to the datagridrow datacontext object (the person)?
2. Can I pass in an object like "
I have a datagrid that lists a bunch of people and a context menu to perform some actions on those people - I'm using commands.
My context menu looks like this:
*
-Add To Policy
-Policy1
-Policy2
-Policy3
-Delete
-Open
-Blah Blah Blah
My problem is this. When adding a person to a policy, I need to pass both the datagridrowcontext (a person) and the policy (a policy) to the command via containerbindings as a CommandParameter.
<
telerik:HierarchicalDataTemplate
x:Key
=
"mnuPolicyTemplateContextMenu"
>
<
telerik:ContainerBinding.ContainerBindings
>
<
telerik:ContainerBindingCollection
>
<
telerik:ContainerBinding
PropertyName
=
"Command"
Binding
=
"{Binding Path=AddResourceToPolicyCommand, Source={StaticResource VMProxy}}"
/>
<
telerik:ContainerBinding
PropertyName
=
"CommandParameter"
>
<
telerik:ContainerBinding.Binding
>
<
ps:AddResourceToPolicyCommandParameter
Person
=
"{Binding *datagridrow*}"
Policy
=
"{Binding *policy*}"
/>
</
telerik:ContainerBinding.Binding
>
</
telerik:ContainerBinding
>
</
telerik:ContainerBinding.ContainerBindings
>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
telerik:HierarchicalDataTemplate
>
1. How can I get a reference back to the datagridrow datacontext object (the person)?
2. Can I pass in an object like "
ps:AddResourceToPolicyCommandParameter
" with those parameters once I retrieve them?