This is a migrated thread and some comments may be shown as answers.

RadPivotFieldList changed event

3 Answers 27 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 07 Apr 2014, 12:58 PM
Hi, I have a RadPivotFieldList connected to a XmlaDataProvider.  I need to know when the user has added new fields, is there an event or something that exposes this?

3 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 07 Apr 2014, 01:06 PM
Hello Glen,

XmlaDataProvider has PrepareDescriptionForField event which is raised when a new description is added via RadPivotFieldList. From the event arguments you can check the type of the description (if it is group - dimension, or aggregate - measure) and you can also modify the created description (by overriding e.Description value).
private void XmlaDataProvider_PrepareDescriptionForField(object sender, Telerik.Pivot.Core.PrepareDescriptionForFieldEventArgs e)
{
    if (e.DescriptionType == DataProviderDescriptionType.Aggregate)
    {
        e.Description = new XmlaAggregateDescription() { MemberName = (e.Description as XmlaGroupDescription).MemberName, CustomName = "Some Name" };
    }
}

Hope this helps. Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Glen
Top achievements
Rank 1
answered on 07 Apr 2014, 02:10 PM
Thanks.  It looks to me like this is called before the field is actually added, is there an event that triggers after it has been added?  Basically I just want to know when the dataprovider is completely updated.
0
Rosen Vladimirov
Telerik team
answered on 07 Apr 2014, 02:17 PM
Hi Glen,

There's no such event, but you can use StatusChanged event of the DataProvider and execute your logic when the status is "Ready". As the event is raised on multiple threads, you have to use a dispatcher in the handler in order to execute your code correctly:
private void XmlaDataProvider_StatusChanged(object sender, Telerik.Pivot.Core.DataProviderStatusChangedEventArgs e)
{
    if (e.NewStatus == Telerik.Pivot.Core.DataProviderStatus.Ready && !(sender as XmlaDataProvider).HasPendingChanges)
    {
        Dispatcher.BeginInvoke(new Action(() => DoSmth();));
    }
}

Hope this helps.

Regards,
Rosen Vladimirov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PivotGrid
Asked by
Glen
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Glen
Top achievements
Rank 1
Share this question
or