This is a migrated thread and some comments may be shown as answers.

how can i pass a contextmenuitem to command parameter?

1 Answer 42 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Ye
Top achievements
Rank 1
Ye asked on 23 Aug 2012, 02:05 PM
<telerik:RadContextMenu.ContextMenu>
                                    <telerik:RadContextMenu>
                                        <telerik:RadMenuItem Header="{Binding Path=AppStrings.ObjectBrowserWindow_AddShortCut, Source={StaticResource ResWrapper}}" Command="{Binding AddShortCutCommand}" >
                                            <i:Interaction.Behaviors>
                                                <Behaviors:SetGridItemAsCommandParameter />
                                            </i:Interaction.Behaviors>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem Header="{Binding Path=AppStrings.ObjectBrowserWindow_RemoveShortCut, Source={StaticResource ResWrapper}}" Command="{Binding RemoveShortCutCommand}" >
                                            <i:Interaction.Behaviors>
                                                <Behaviors:SetGridItemAsCommandParameter />
                                            </i:Interaction.Behaviors>
                                        </telerik:RadMenuItem>
                                    </telerik:RadContextMenu>
                                </telerik:RadContextMenu.ContextMenu>


i use behaviors, but sometimes it caused system stackoverflowexception.
 is there any way to bind the radmenuitem to command parameter? 


1 Answer, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 27 Aug 2012, 02:48 PM
Hi,

We are not exactly sure of your idea and what do you want to achieve, but we have created a simple project to illustrate our idea. Please check it and if this i not the behavior you want, send us a project or give us more details what is your problem.
We were wondering - how did you implement the Behavior: "SetGridItemAsCommandParameter" - did you use Blend or something else?

Hopefully the attached project helps.

All the best,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Menu
Asked by
Ye
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Share this question
or