Window has no .show

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    33 posts
    Member since:
    Jun 2012

    Posted 13 Dec 2012 Link to this post

    I used the RadControlsScenario to create a Window just to see how it works and things went well until I tried to Compile and open it.   The first think I found was no RadControlsScenario.Show(), How do you show the window.  The second is The name 'InitializeComponent' does not exist in the current context.  My namespace is the same as the main window that would be calling it.

    An object reference is required for the non-static field, method, or property 'System.Windows.Window.ShowDialog()'

    Built with RadControl Scenario
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    using System.Threading.Tasks;
    using Telerik.Windows.Controls;
    namespace My.Controls
        /// <summary>
        /// Interaction logic for RadSalesPersonRCS1.xaml
        /// </summary>
        public partial class RadSalesPersonRCS1 : Window
            public RadSalesPersonRCS1()

    Where I try to open it from my main Window
    private void MenuItem_ViewSalesPerson(object sender, RoutedEventArgs e)
              RadSalesPersonRCS1 salesperson = new RadSalesPersonRCS1();

  2. Boyan
    Boyan avatar
    758 posts

    Posted 18 Dec 2012 Link to this post

    Hello Stephan,

    RadControlScenario should add new RadWindow as UserControl, and you should create new instance of it in your code and use its Show() method as shown in this help article. As far as I can see there is a Microsoft Window instead of RadWindow in the code you send us. So you could try to replace Window with RadWindow and also check if the correct Telerik binaries are added to the references of the project(although they should be added by default when use Telerik scenario).

    If you are still having this problem, could you please send us a sample project in order to investigate it further.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top