RadPivotFieldList changed event

4 posts, 0 answers
  1. Glen
    Glen avatar
    17 posts
    Member since:
    Aug 2010

    Posted 07 Apr 2014 Link to this post

    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?
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 07 Apr 2014 Link to this post

    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.

     
  3. DevCraft banner
  4. Glen
    Glen avatar
    17 posts
    Member since:
    Aug 2010

    Posted 07 Apr 2014 in reply to Rosen Vladimirov Link to this post

    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.
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 07 Apr 2014 Link to this post

    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.

     
Back to Top