Hi,
I am building a cube/analytics viewer for a client and the RadPivotGrid and RadPivotFieldList combination works really well until we try to swap the connection string and point the RadPivotFieldList control at the new cube.
However when we change the cube in the connection string the RadPivotGrid reloads with the new report, however the RadPivotFieldList does not refresh it's field list, so we are stuck with the same fields as the first cube.
Both cubes work as we can load either of them first, just never change it.
I am doing this in codebehind and viewmodel (long story) and storing the serialised data provider in SQL, (this all works beautifully).
My latest code looks like this;
private Telerik.Pivot.Adomd.AdomdDataProvider _provider { get; set; }
var x = _viewModel.DataProvider;
_provider = new AdomdDataProvider();
_provider = (Telerik.Pivot.Adomd.AdomdDataProvider)x;
var url = _viewModel.Analytics.GetOrDefault("AnalyticsURL");
var database = _viewModel.SelectedCube.Catalog;
var cube = _viewModel.SelectedCube.Cube;
var ConnectionSettings = new Telerik.Pivot.Adomd.AdomdConnectionSettings()
{
Cube = cube,
Database = database,
ConnectionString = String.Format("Data Source={0}", url)
};
_provider.ConnectionSettings = ConnectionSettings;
_provider.BeginInit();
radPivotGrid.DataProvider = _provider;
radPivotFieldList.DataProvider = _provider;
_provider.EndInit();
The 'Cube' is the only bit that changes in the connection string.
I have looked online and cannot find any links to switching the cube at runtime, is there anyway to do this?
thanks for the help.
craig