Pivot grid not working

16 posts, 0 answers
  1. Daniel
    Daniel avatar
    21 posts
    Member since:
    Nov 2007

    Posted 10 Apr 2013 Link to this post


    Hi,

    I've been trying the examples with Pivot Grid but any of them seems to work.
    I don't get any error message but the control doesn't show. 
    Does it need any prerequisites?

    <Window x:Class="RadPivotGrid_GettingStarted.MainWindow"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:local="clr-namespace:WpfApplication1.RadPivotGrid_GettingStarted"
                    xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot"
                    Title="MainWindow" Height="350" Width="525" >
         
         
        <Window.Resources>
            <pivot:LocalDataSourceProvider x:Key="LocalDataProvider" AggregatesPosition="Rows">
                <pivot:LocalDataSourceProvider.RowGroupDescriptions>
                    <pivot:PropertyGroupDescription PropertyName="Name" />
                </pivot:LocalDataSourceProvider.RowGroupDescriptions>
                <pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
                    <pivot:DateTimeGroupDescription PropertyName="Date" Step="Month" />
                </pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
                <pivot:LocalDataSourceProvider.AggregateDescriptions>
                    <pivot:PropertyAggregateDescription PropertyName="Price" StringFormat="C" AggregateFunction="Average" />
                    <pivot:PropertyAggregateDescription PropertyName="Quantity"/>
                </pivot:LocalDataSourceProvider.AggregateDescriptions>
            </pivot:LocalDataSourceProvider>
        </Window.Resources>
     
        <Grid>
            <pivot:RadPivotGrid Name="radPivotGrid1" DataProvider="{StaticResource LocalDataProvider}" >
            </pivot:RadPivotGrid>
        </Grid>
    </Window>


    Imports System
    Imports System.Collections.Generic
    Imports System.Windows
    Imports Telerik.Pivot.Core
     
     
    Namespace RadPivotGrid_GettingStarted
     
    Public Class Product
            Public Property Name() As String
                Get
                    Return m_Name
                End Get
                Set(ByVal value As String)
                    m_Name = value
                End Set
            End Property
            Private m_Name As String
            Public Property Quantity() As Integer
                Get
                    Return m_Quantity
                End Get
                Set(ByVal value As Integer)
                    m_Quantity = value
                End Set
            End Property
            Private m_Quantity As Integer
            Public Property Price() As Double
                Get
                    Return m_Price
                End Get
                Set(ByVal value As Double)
                    m_Price = value
                End Set
            End Property
            Private m_Price As Double
            Public Property [Date]() As DateTime
                Get
                    Return m_Date
                End Get
                Set(ByVal value As DateTime)
                    m_Date = value
                End Set
            End Property
            Private m_Date As DateTime
        End Class
     
        Partial Public Class MainWindow
            Public Sub New()
                InitializeComponent()
                Try
                    TryCast(Me.Resources("LocalDataProvider"), LocalDataSourceProvider).ItemsSource = GeneratePivotData()
                Catch ex As Exception
     
                End Try
     
            End Sub
     
            Private Shared Function GeneratePivotData() As IList(Of Product)
                Dim PivotData As IList(Of Product) = New List(Of Product)() From { _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 1, 1, 0, 0, 0), _
             .Price = 10.4, _
             .Quantity = 148 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 2, 1, 0, 0, 0), _
             .Price = 10.99, _
             .Quantity = 122 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 3, 1, 0, 0, 0), _
             .Price = 11.24, _
             .Quantity = 80 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 4, 1, 0, 0, 0), _
             .Price = 11.24, _
             .Quantity = 90 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 5, 1, 0, 0, 0), _
             .Price = 11.14, _
             .Quantity = 140 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 6, 1, 0, 0, 0), _
             .Price = 10.89, _
             .Quantity = 162 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 7, 1, 0, 0, 0), _
             .Price = 10.89, _
             .Quantity = 181 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 8, 1, 0, 0, 0), _
             .Price = 10.88, _
             .Quantity = 180 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 9, 1, 0, 0, 0), _
             .Price = 11.0, _
             .Quantity = 116 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 10, 1, 0, 0, 0), _
             .Price = 10.99, _
             .Quantity = 128 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 11, 1, 0, 0, 0), _
             .Price = 10.95, _
             .Quantity = 145 _
            }, _
            New Product() With { _
             .Name = "Pen", _
             .[Date] = New DateTime(2012, 12, 1, 0, 0, 0), _
             .Price = 10.45, _
             .Quantity = 189 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 1, 1, 0, 0, 0), _
             .Price = 5.22, _
             .Quantity = 100 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 2, 1, 0, 0, 0), _
             .Price = 5.99, _
             .Quantity = 85 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 3, 1, 0, 0, 0), _
             .Price = 6.04, _
             .Quantity = 80 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 4, 1, 0, 0, 0), _
             .Price = 6.28, _
             .Quantity = 72 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 5, 1, 0, 0, 0), _
             .Price = 6.12, _
             .Quantity = 99 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 6, 1, 0, 0, 0), _
             .Price = 6.59, _
             .Quantity = 40 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 7, 1, 0, 0, 0), _
             .Price = 6.29, _
             .Quantity = 68 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 8, 1, 0, 0, 0), _
             .Price = 5.99, _
             .Quantity = 95 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 9, 1, 0, 0, 0), _
             .Price = 5.89, _
             .Quantity = 120 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 10, 1, 0, 0, 0), _
             .Price = 5.99, _
             .Quantity = 105 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 11, 1, 0, 0, 0), _
             .Price = 5.96, _
             .Quantity = 111 _
            }, _
            New Product() With { _
             .Name = "Pencil", _
             .[Date] = New DateTime(2012, 12, 1, 0, 0, 0), _
             .Price = 5.99, _
             .Quantity = 108 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 1, 1, 0, 0, 0), _
             .Price = 22.86, _
             .Quantity = 88 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 2, 1, 0, 0, 0), _
             .Price = 23.02, _
             .Quantity = 95 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 3, 1, 0, 0, 0), _
             .Price = 23.22, _
             .Quantity = 102 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 4, 1, 0, 0, 0), _
             .Price = 21.99, _
             .Quantity = 95 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 5, 1, 0, 0, 0), _
             .Price = 22.45, _
             .Quantity = 84 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 6, 1, 0, 0, 0), _
             .Price = 22.56, _
             .Quantity = 96 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 7, 1, 0, 0, 0), _
             .Price = 22.88, _
             .Quantity = 88 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 8, 1, 0, 0, 0), _
             .Price = 22.42, _
             .Quantity = 99 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 9, 1, 0, 0, 0), _
             .Price = 22.56, _
             .Quantity = 111 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 10, 1, 0, 0, 0), _
             .Price = 22.18, _
             .Quantity = 102 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 11, 1, 0, 0, 0), _
             .Price = 22.93, _
             .Quantity = 105 _
            }, _
            New Product() With { _
             .Name = "Notebook", _
             .[Date] = New DateTime(2012, 12, 1, 0, 0, 0), _
             .Price = 22.89, _
             .Quantity = 122 _
            } _
           }
     
                Return PivotData
            End Function
        End Class
     
     
    End Namespace

  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 10 Apr 2013 Link to this post

    Hello Daniel,

    I've prepared an application with your code and it is working fine. You can find it attached and test it on your side. I've included needed binaries in the project. Are you sure you are referring XAML assemblies in your application. This issue may occur if you are using NoXAML assemblies and you have not merged any dictionaries? Could you check this?

    I'm looking forward to hearing from you.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Thomas
    Thomas avatar
    28 posts
    Member since:
    Jun 2010

    Posted 11 Apr 2013 Link to this post

    Hello,

    i have got the same problem. I downloaded your "getting started" project and started it within visual studio --> empty window.
    when i execute the compiled binary in bin/debug i can see the full pivot grid. the same problem exists with the demos!

    i had the same problem with the q1 release without Sp1:
    http://www.telerik.com/community/forums/wpf/pivotgrid/highlight-row-on-mouse-over-and-double-click-event.aspx

    i use VisualStudio 2010 on Windows XP.

    Best Regards,
    Thomas
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 11 Apr 2013 Link to this post

    Hi Thomas,

    We are not aware of such problem. Could you try turning on all exceptions in visual studio (Debug -> Exceptions - check all checkboxes) and see if it will give you an exception somewhere. If this doesn't help, could you try to remove all Telerik controls from the application I've sent you and put a simple button. This will help us to determine if the problem is with our controls or with the VisualStudio itself.

    I'm looking forward to hearing from you.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Thomas
    Thomas avatar
    28 posts
    Member since:
    Jun 2010

    Posted 11 Apr 2013 Link to this post

    Hello,

    i activated all Exceptions, but no exception occured. A normal Button was visible.
    When i run the Demo-Project, all other Controls (like RadGrid for example) are working correctly. Only the pivot grid is not visible.

    in the output screen, i can see that 3 assemblies from telerik are loaded in your getting started project:
    Telerik.Pivot.Core.dll
    Telerik.Windows.Controls.Pivot.dll
    Telerik.Windows.Controls.dll

    Best Regards,
    Thomas
  7. Daniel
    Daniel avatar
    21 posts
    Member since:
    Nov 2007

    Posted 12 Apr 2013 Link to this post

    Hi again,

    Even using your proyect I get the same

    I have the same problem as Thomas: when I execute the compiled binary in bin/debug I can see the full pivot grid. And he same problem  with demos
  8. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 12 Apr 2013 Link to this post

    Hello Thomas and Daniel,

    We have finally reproduced the problem. I'll try to explain the full details of it. RadPivotGrid is using System.ComponentModel.DataAnnotations internally. VisualStudio has a hosting process, which is used for partial trust debugging, and design time expression evaluation. But when this process is enabled (which is its default state) it is trying to access different methods from the referred assemblies. In some of them, which are based on DataAnnotations methods, the hosting process is not able to access the information, which it needs. This is caused by a bug in the DataAnnotations assembly, which is fixed in .NET 4.5. As you are unable to install .NET 4.5 on Windows XP machine, the only option is to disable visual studio hosting process. To do this, right-click on your project file, choose Properties and after that go to the Debug tab. You will find a checkbox there, which indicates that the hosting process is enabled. Remove the check and after that your application should work fine.

    Could you try this approach and inform us if you still have any problems or concerns.

    Kind regards,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  9. Daniel
    Daniel avatar
    21 posts
    Member since:
    Nov 2007

    Posted 15 Apr 2013 Link to this post

    It works now,

    Thanks for your help :)
  10. Daniel
    Daniel avatar
    21 posts
    Member since:
    Nov 2007

    Posted 24 Apr 2013 Link to this post

    Hi again!

    now that I have the Pivot Grid working fine I've tried to add a Pivot Field List control.

    Following your instructions in http://www.telerik.com/help/wpf/radpivotgrid-fieldlist-started.html 
    I just added the references to the Telerik assemblies, and the line 
    <pivot:RadPivotFieldList Name="radPivotFieldList1" Grid.Column="1"  DataProvider="{StaticResource LocalDataProvider}"/>

    to the xaml file.

    Running the proyect I get an error in the line InitializeComponent()
    Any idea why is this happening?

    Thanks :)
  11. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 24 Apr 2013 Link to this post

    Hi Daniel,

    Have you added reference to Telerik.Windows.Data.dll  - I've just noticed it is missing in the article, but you'll need it if you want to use RadPivotFieldList. Could you try adding it and share what is the result? I'll update the article at our earliest.

    I'm looking forward to hearing from you.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  12. Daniel
    Daniel avatar
    21 posts
    Member since:
    Nov 2007

    Posted 24 Apr 2013 Link to this post

    I still get the same error on  InitializeComponent()...

    I get this exception (in spanish, sorry)

    System.Windows.Markup.XamlParseException occurred
      LineNumber=34
      LinePosition=10
      Message='La invocación del constructor del tipo 'Telerik.Windows.Controls.RadPivotFieldList' que coincide con las restricciones de enlace especificadas produjo una excepción.' (número de línea: '34'; posición de línea: '10').
      Source=PresentationFramework
      StackTrace:
           en System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
           en System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
           en System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
           en System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
           en System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
           en WpfApplication1.RadPivotGrid_GettingStarted.MainWindow.InitializeComponent() en E:\Users\usuario\Documents\Visual Studio 2010\Projects\RadPivotGrid_GettingStarted - copia (2)\RadPivotGrid_GettingStarted\obj\x86\Debug\MainWindow.g.vb:línea 98
           en WpfApplication1.RadPivotGrid_GettingStarted.MainWindow..ctor() en E:\Users\usuario\Documents\Visual Studio 2010\Projects\RadPivotGrid_GettingStarted - copia (2)\RadPivotGrid_GettingStarted\MainWindow.xaml.vb:línea 50
      InnerException: System.TypeInitializationException
           Message=Se produjo una excepción en el inicializador de tipo de 'Telerik.Windows.Controls.RadPivotFieldList'.
           Source=mscorlib
           TypeName=Telerik.Windows.Controls.RadPivotFieldList
           StackTrace:
                en System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType type)
                en System.Runtime.Serialization.FormatterServices.GetUninitializedObject(Type type)
                en System.Xaml.Schema.XamlTypeInvoker.DefaultCtorXamlActivator.CallCtorDelegate(XamlTypeInvoker type)
                en System.Xaml.Schema.XamlTypeInvoker.DefaultCtorXamlActivator.CreateInstance(XamlTypeInvoker type)
                en System.Xaml.Schema.XamlTypeInvoker.CreateInstance(Object[] arguments)
                en MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstanceWithCtor(XamlType xamlType, Object[] args)
                en MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(XamlType xamlType, Object[] args)
           InnerException: System.IO.FileLoadException
                FileName=Telerik.Pivot.Core, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
                FusionLog==== Información de estado anterior al enlace ===
    LOG: Usuario = PC2002\usuario
    LOG: DisplayName = Telerik.Pivot.Core, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
     (Fully-specified)
    LOG: Appbase = file:///E:/Users/usuario/Documents/Visual Studio 2010/Projects/RadPivotGrid_GettingStarted - copia (2)/RadPivotGrid_GettingStarted/bin/Debug/
    LOG: PrivatePath inicial = NULL
    Ensamblado de llamada : Telerik.Windows.Controls.PivotFieldList, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.
    ===
    LOG: Este enlace empieza en el contexto de carga default.
    LOG: No se encontró ningún archivo de configuración de la aplicación.
    LOG: Utilizando el archivo de configuración de host:
    LOG: Utilizando el archivo de configuración del equipo en C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Referencia posterior a la directiva: Telerik.Pivot.Core, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
    LOG: Intento de descarga de la nueva dirección URL file:///E:/Users/usuario/Documents/Visual Studio 2010/Projects/RadPivotGrid_GettingStarted - copia (2)/RadPivotGrid_GettingStarted/bin/Debug/Telerik.Pivot.Core.DLL.
    AVS: Al comparar el nombre de ensamblado se generó la incompatibilidad: Número de compilación
    ERR: Error al completar la instalación del ensamblado (hr = 0x80131040). Finalizó la búsqueda.
     
                Message=No se puede cargar el archivo o ensamblado 'Telerik.Pivot.Core, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' ni una de sus dependencias. La definición del manifiesto del ensamblado no coincide con la referencia al ensamblado. (Excepción de HRESULT: 0x80131040)
                Source=Telerik.Windows.Controls.PivotFieldList
                StackTrace:
                     en Telerik.Windows.Controls.RadPivotFieldList..cctor()
                InnerException:




  13. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 24 Apr 2013 Link to this post

    Hi Daniel,

    May I ask you to check if all assemblies in your application have the same version? From the error it looks like Visual Studio is unable to find Telerik.Pivot.Core version 2013.1 403. All referenced assemblies must have the same version.

    I'm looking forward to hearing from you.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  14. Daniel
    Daniel avatar
    21 posts
    Member since:
    Nov 2007

    Posted 24 Apr 2013 Link to this post

    It works now :)

    Thanks for your help!
  15. Thnghi
    Thnghi avatar
    9 posts
    Member since:
    Feb 2013

    Posted 01 Aug 2013 Link to this post

    Hi All,

    I have a problem with change item source for Pivot grid. I have a filter form, when apply button clicked, I change data source for Pivot grid by the way:
     var localDataProvider = LayoutRoot.Resources["LocalDataProvider"] as LocalDataSourceProvider;
                 localDataProvider.ItemsSource = dataList;
                 localDataProvider.Refresh();

    but it only works on the first time, pivot grid does not change data source although my dataList changed.

    Can any one help me?, thanks you very much
  16. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 02 Aug 2013 Link to this post

    Hi Thnghi,

    We are not aware of such issue. I've tried to reproduce it with attached project, but without success. Could you give it a try and modify it in order to reproduce your problem, so we'll be able to investigate it on our side. Also I would like to ask you for the exact version of RadControls which you are using.

    I'm looking forward to hearing from you.

    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 >>
  17. Cecilia
    Cecilia  avatar
    1 posts
    Member since:
    Apr 2014

    Posted 23 Jul 2015 Link to this post

    Eliminar del constructor de la clase la siguiente linea.

    AdomdDataProvider adomdDataProvider = new AdomdDataProvider();

    Saludos.

Back to Top
UI for WPF is Visual Studio 2017 Ready