To open new screen with Context Menu

2 posts, 0 answers
  1. Parul
    Parul avatar
    22 posts
    Member since:
    Dec 2010

    Posted 03 May 2011 Link to this post

    Hi All,

    i am using Wpf 4.0 and PRISM for my dot net application (Visual Studio 2010).

    I have one requirement that I have to open a new screen (View) on the click of one of the items of context menu.
    I have written the following code for it in my XAML :
    <framework:RTPOGridView Grid.Row="1"
             x:Name="orderList" Margin="7,0,7,0"
             VerticalAlignment="Stretch" ItemsSource="{Binding dailyload}" >
                     <telerik:RadContextMenu.ContextMenu>
      
                        <telerik:RadContextMenu x:Name="ViewErrorsContextMenu" IsEnabled="True" >
                            <telerik:RadContextMenu.Items>
                            <telerik:RadMenuItem Header="View Errors" x:Name="itemViewErrors" IsEnabled="True" Command="{Binding Path=ViewErrorsCommand}" >
                                      
                                </telerik:RadMenuItem>
                           </telerik:RadContextMenu.Items>
                        </telerik:RadContextMenu>
      
      
                    </telerik:RadContextMenu.ContextMenu>
      
      
                <framework:RTPOGridView.Columns>
                    <telerik:GridViewDataColumn  Header="Customer" DataMemberBinding="{Binding CustomerPerson}" Width="*" />
                    <telerik:GridViewDataColumn  Header="Product" DataMemberBinding="{Binding Product}" Width="*" />
                            </framework:RTPOGridView>

     

     

    and the code which i wrote for it in View Model is as follows.

    public void OnViewErrorsCommand(object sender, RoutedEventArgs e)
            {
                _dialogController.ShowDialog(_moduleController, ApplicationConstants.OrdersViewNames.ViewErrors);         
      
            }
    Where "ViewErrors" is my new screen need to be opened on the click of the context menu.

    kindly let me know the solution.

    Thanks in advance !!!!!!!
  2. George
    Admin
    George avatar
    1332 posts

    Posted 09 May 2011 Link to this post

    Hi Parul, 


    Please, refer to our online documentation:

    I hope this helps.


    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top