Is it possible to bind dynamic object to PivotGrid

6 posts, 2 answers
  1. Vadimir
    Vadimir avatar
    24 posts
    Member since:
    Aug 2013

    Posted 25 Oct 2013 Link to this post

    Hi
    I’m working on a project to create pivot table dynamically.

    The goal is to build a pivot table based on 2 Collections, which is generated by reading some file. The 1st collection defines the column names and type (e.g. double, string, etc.) of the data. The 2nd one contains a list of strings, which represents all the data, so the type of the data is only known at run time.

    I'd like to know is it possible to bind the above data structure to the RadPivotGrid. 

    I've tried to set a Collection of dynamic objects to the ItemsSource by using LocalDataSourceProvider, but it seems the data are not shown in the pivot table.

    An example of the dynamic object.
    dynamic dObject1 = new ExpandoObject();
    dObject1.Name = "Name1";
    dObject1.Value = 1;

    Thanks in advance.

    Regards,
    Gong
  2. Answer
    Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 28 Oct 2013 Link to this post

    Hello Gong,

    Thank you for contacting us. Currently it is not possible to use ExpandoObject as a source for RadPivotGrid. You can use ICustomTypeProvider instead. Another option is to convert your ExpandoObject to DataTable at runtime as shown in this thread.

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

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Vadimir
    Vadimir avatar
    24 posts
    Member since:
    Aug 2013

    Posted 28 Oct 2013 Link to this post

    Hi Rosen,

    Thanks. I'll go for the DataTable solution. It would be nice to have a DataTable binding example in the document. I didn't know that it is possible.

    Regards,
    Gong
  5. Answer
    Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 28 Oct 2013 Link to this post

    Hi Gong,

    In this article is mentioned that you can use DataTable as ItemsSource of LocalDataSourceProvider, but we'll consider adding a full example.

    Feel free to contact us in case you face any problems with the usage of RadPivotGrid with DataTable.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Ql
    Ql avatar
    3 posts
    Member since:
    Dec 2013

    Posted 17 Dec 2013 Link to this post

    Hi Rosen ,
    Where can i download the full sample of using DataTable as ItemsSource of LocalDataSourceProvider? Could you provider the link?
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 20 Dec 2013 Link to this post

    Hello Ql,

    We have prepared a small sample example which demonstrates the exact approach on using DataTable as ItemsSource of the LocalDataSourceProvider. Please check the attachment.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready