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

Sparkline in treelistview

1 Answer 37 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Paul Lewis
Top achievements
Rank 1
Paul Lewis asked on 20 Jul 2011, 09:28 AM
Hi,

I was looking at putting a part line in my treelistview but when i added the control into the template i get the following error at design time and crash at runtime

System.NullReferenceException
Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Sparklines.DataPointsCollectionView.FindProjectedMemberType(String sourceMemberPath) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Data\DataPointsCollectionView.cs:line 185
   at Telerik.Windows.Controls.Sparklines.DataPointsCollectionView.AdjustSourcePath(String& sourceMemberPath) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Data\DataPointsCollectionView.cs:line 202
   at Telerik.Windows.Controls.Sparklines.DataPointsCollectionView.InitializeDescriptor(String sourceMemberPath, String projectedMemberPath) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Data\DataPointsCollectionView.cs:line 190
   at Telerik.Windows.Controls.Sparklines.DataPointsCollectionView.TryInitializeDescriptor(String sourceMemberPath, String projectedMemberPath, SelectDescriptor descriptor) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Data\DataPointsCollectionView.cs:line 161
   at Telerik.Windows.Controls.Sparklines.DataPointsCollectionView.UpdateDescriptor(String sourceMemberPath, String projectedMemberPath) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Data\DataPointsCollectionView.cs:line 139
   at Telerik.Windows.Controls.Sparklines.RadSparklineBase.OnItemsSourceChanged(IEnumerable newSource) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Base\RadSparklineBase.cs:line 651
   at Telerik.Windows.Controls.Sparklines.RadSparklineBase.ItemsSourcePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Controls\DataVisualization\Sparklines\Base\RadSparklineBase.cs:line 534
   at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_SL\Sources\Development\Core\Controls\Common\System.Windows\PropertyMetadata.cs:line 208
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.SendDataToTarget()
   at System.Windows.Data.BindingExpression.SourceAcquired()
   at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
   at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
   at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
   at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive)
   at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent)
   at MS.Internal.FrameworkCallbacks.ManagedPeerTreeUpdate(IntPtr oldParentElement, IntPtr parentElement, IntPtr childElement, Byte bIsParentAlive, Byte bKeepReferenceToParent, Byte bCanCreateParent)

<telerik:RadTreeListView x:Name="RadTreeListView1" RowLoaded="RadTreeListView1_RowLoaded"
                         AutoGenerateColumns="False" CanUserFreezeColumns="False"  ItemsSource="{Binding KpiItems, ElementName=Vm}"
                         IsReadOnly="True" RowIsExpandedChanged="RadTreeListView1_RowIsExpandedChanged">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:RadTreeListView.Columns>
        <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Label}"/>
        <telerik:GridViewDataColumn Width="6*" IsResizable="False" Header="actuals Visits" TextAlignment="Center">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadLinearSparkline ItemsSource="{Binding sl}" XValuePath="VisitDate" YValuePath="NumberOfVisitsField"  />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
        </telerik:GridViewDataColumn>
 
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>

1 Answer, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 25 Jul 2011, 09:07 AM
Hello Paul Lewis,

It looks like most probably you have misspelled your YValuePath or XValuePath and it is not matching the property name of your data object. If your problems persist, please send us a small runnable project illustrating the issue and we will take a closer look for you.

Regards,
Vladimir Milev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
TreeListView
Asked by
Paul Lewis
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Share this question
or