radwindow in prism

10 posts, 0 answers
  1. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 15 Dec 2010 Link to this post

    I have a radwindow control in one of my modules. This module needs to popup a radwindow with a grid inside it on an event subscription from other modules. How can I go about this.
    Thanks.
  2. George
    Admin
    George avatar
    1332 posts

    Posted 20 Dec 2010 Link to this post

    Hello,

    Attached you can find the sample. I hope this helps.
     

    All the best,
    George
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2010 Link to this post

    This is a great example. Thanks a lot.
    While implementing in my project I am trying to open the pop up on a chart's ItemClick event.

    in XAML: I have

    <chart:ChartArea ItemClick="{Binding showPopupCommand}"> 

    In the viewModel I have the following lines of code:

     

    private readonly ICommand showPopupCommand;
    
    this.showPopupCommand = new DelegateCommand(this.ShowPopupView);
    
    
    
    private void ShowPopupView()
    
    {
    	//Need to show a popup 
    	string test = "test"; //entered this for test to see if I can get to here.
    
    }
    

     

    I am getting an Exception on InitializeComponent()

    Failed to assign to property 'Telerik.Windows.Controls.Charting.ChartArea.ItemClick'. 

    I am not sure if I am missing any pieces.




  5. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 23 Dec 2010 Link to this post

    Hello scorp,

    ChartArea.ItemClick is an event and not a command -- you can hook up an event handler to it, but you cannot bind a command.

    Generally the current version of RadChart does not provide support for ItemClick commanding but we will be introducing ChartArea.Command / CommandParameter properties for the official Q3 2010 SP1 release (around mid-January) and then you will be able to achieve the desired functionality.

    You can also preview the commanding functionality by downloading the weekly internal build from your Client.Net account right now.


    Best wishes,
    Freddie
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  6. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 27 Dec 2010 Link to this post

    Thanks for the reply. 
    I have a couple of questions from the example project provided:
    1) How do I pass on the event parameters from the shell public void ShowRadWindow(string commandName)
     which we subscribed to to WindowContentViewModel.cs to display appropriate content.

    2) I am having one small issue where I open the radwindow and fill in a gridview inside it with some data. After the grid loads up the radwindow resizes and is not in the center of the screen even though in the shell I have the below code:

    MyRadWindow obj = new MyRadWindow();
                    obj.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen;
                    obj.ShowDialog();

    How can I center the radwindow.
    Thanks.
  7. George
    Admin
    George avatar
    1332 posts

    Posted 03 Jan 2011 Link to this post

    Hello,

    Straight to your questions:



    Best wishes,
    George
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  8. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 04 Jan 2011 Link to this post

    Please take a look at the project. 
    https://www.sendthisfile.com/vyUJwtSlg6sagO7d7zs8DJhk

    I need to center the radwindow after the grid loads up. I am not sure how to achieve this.
  9. George
    Admin
    George avatar
    1332 posts

    Posted 07 Jan 2011 Link to this post

    Hi,

     
    You don't need to pass the WindowContentViewModel as parameter from other project. You could set the ViewModel like:

    public WindowContentView()
            {
                InitializeComponent();
                this.DataContext = new WindowContentView();
            }


     Anyway, I have an example how to pass parameters using prism events. Attached you can find the sample. I hope this helps.


    Kind regards,
    George
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  10. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 07 Jan 2011 Link to this post

    Hey George, Thanks for taking a look.
    However your example does not address the issue of centering the RadWindow when you have a grid inside of it.
    Please refer to the example project I have uploaded at https://www.sendthisfile.com/vyUJwtSlg6sagO7d7zs8DJhk
    where the Radwindow does not center itself.
    Thanks.
  11. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 11 Jan 2011 Link to this post

    Hello Scorp,

     To share a file with us you might open a support ticket and attach the file.

    About the problem you are experiencing - the window might not be centered, because its real size is found out after it is centered. Because of this the window was centered according to smaller size and after the size is changed it doesn't center again (this is by design). What you could do is to either make sure its correct size is determined on the first measure pass or to center the window manually once the final size is determined.

    Greetings,

    Miroslav Nedyalkov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner