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

DataSource

1 Answer 112 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 24 Oct 2012, 12:37 PM
Hi,

is there any Example with datasource binding?
What is possible (xml, sqlite,...)?
Whats the best way?

Thanks
Best Regards
Rene

1 Answer, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 25 Oct 2012, 11:22 AM
Hello Rene,

The LocalDataSourceProvider is not a dependency object and you can not bind its ItemsSource property. We have developed it this way because we have some concerns using Bindings. Anyway there are several ways to set your ItemsSource:
  •  Use a StaticResource
  •  As in our "FirstLook" example here use your custom reader. This way you can read an XML file and parse it to your RadPivotGrid.
  • Set the ItemsSource directly in the code to any collection (local or created from your database data) that implements IList interface:
(this.Resources["LocalDataProvider"] as LocalDataSourceProvider).ItemsSource = GeneratePivotData();
 
//----
 
private static IList<Product> GeneratePivotData()
{
    IList<Product> PivotData = new List<Product>()
    {
       new Product() { Name = "Pen", Price = 10.40, Quantity = 148 },
       new Product() { Name = "Pencil", Price = 10.99, Quantity = 122 },
       new Product() { Name = "Notebook", Price = 11.24, Quantity = 80 },
    };
    return PivotData;
}

You may also use XMLA and ADOMD for taking advantage of OLAP data operations.

I suggest you to take a closer look at our demos here. Don't hesitate to contact us if you have any problems with RadPivotGrid usage.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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