We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load the OlapChart control dynamically from a UserControl

Platform: Silverlight |
Control: OlapClient

This can be achieved by adding the OlapChart in a separate user control. The procedure to bind the data to OlapChart is, First the OlapChart’s framework must be loaded with applied templates and then the OlapDatamanager should set and bind the data. So while you add the OlapChart dynamically from the Usercontrol, we have to set the OlapDataManager in the Loaded event of OlapChart (i.e., After the OlapChart is initialized).

Please find the code snippet as below.


public MainPage()




SilverlightControl1.MyOlapChart.Loaded += new RoutedEventHandler(MyOlapChart_Loaded);

string MdxString = " SELECT NONEMPTY({[Measures].[Internet Sales Amount]}) dimension properties member_type, PARENT_UNIQUE_NAME ON COLUMNS , NONEMPTY( VISUALTOTALS( ({{Drilldownlevel({ [Date].[Fiscal] })}}) ),{[Measures].[Internet Sales Amount]}) dimension properties member_type, PARENT_UNIQUE_NAME ON ROWS FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE";

this.DataManager = new OlapDataManager();

this.DataManager.DataProvider = dataProvider;

this.DataManager.MdxQuery = MdxString;


void MyOlapChart_Loaded(object sender, RoutedEventArgs e)


SilverlightControl1.MyOlapChart.OlapDataManager = this.DataManager;





You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile