9 Answers, 1 is accepted
Attached you can find the sample. I hope this helps.
George
the Telerik team
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.
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
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.
Straight to your questions:
- I would suggest you to refer to the following links - http://www.codeproject.com/KB/dotnet/Prism_Aggregator_Service.aspx and http://neverindoubtnet.blogspot.com/2009/05/event-aggregator-in-prism-explorer.html
- I tried to reproduce the problem, but to no avail. Could you please send us a running sample that reproduces the problem. It would be very helpful in further resolving the problem.
George
the Telerik team
https://www.sendthisfile.com/vyUJwtSlg6sagO7d7zs8DJhk
I need to center the radwindow after the grid loads up. I am not sure how to achieve this.
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.
George
the Telerik team
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.
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,
the Telerik team