Pivot Grid showing nothing

2 posts, 0 answers
  1. Alex
    Alex avatar
    1 posts
    Member since:
    Oct 2015

    Posted 20 Oct 2015 Link to this post

    I have tried setting up a pivot grid following the demos at http://demos.telerik.com/aspnet-mvc/pivotgrid/local-flat-data-binding and http://demos.telerik.com/aspnet-mvc/pivotgrid/remote-flat-data-binding.


    using this model

    public class FundModel
        public string AssetClass { get; set; }
        public DateTime ReportDate { get; set; }
        public decimal? AssetsStart { get; set; }

     and this controller


    public ActionResult TestView()
        return View(
           // GetAdvisors()
    private IEnumerable<FundModel> GetFunds()
        IEnumerable<FundModel> funds;
        using (var context = new EPFRUI_Entities())
            funds = context.vwDailyFundFlowDetails.Take(300).Select(x => new FundModel
                AssetClass = x.FundName,
                ReportDate = x.ReportDate,
                AssetsStart = x.AssetsStart
        return funds;

     ​I am passing in my data to this pivot grid based on the demo code


        .DataSource(dataSource => dataSource
            .Schema(schema => schema
                .Model(m => m.Field("CategoryName", typeof(string)).From("Category.CategoryName"))
                .Cube(cube => cube
                    .Dimensions(dimensions => {
                        dimensions.Add(model => model.AssetsStart).Caption("Assets Start");
                        dimensions.Add("CategoryName").Caption("All Categories");
                        dimensions.Add(model => model.AssetClass).Caption("AssetClass");
                .Measures(measures => measures.Add("AssetsStart").Field(model => model.AssetsStart).AggregateName("count"))
            .Columns(columns =>
            .Rows(rows => rows.Add("AssetClass").Expand(true))
            .Measures(measures => measures.Values("Sum"))
            .Events(e => e.Error("onError"))


    Which is getting me a single long line when I run the program and navigate to the view. I have included what shows up in the attached image.


    I have also tried setting this up with remote binding and got the same view.


    Am I missing an obvious step here? I debugged it and the model has data when the pivot grid is called, and no errors are coming back from the pivotgrid




  2. Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 22 Oct 2015 Link to this post

    Hello Alex,

    I reviewed the code snippets and noticed that you are adding same dimensions for both axes, which is not supported. If the dimensions are setup correctly, the widget works as expected:
    Georgi Krustev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top