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

DependencyProperty.UnsetValue

3 Answers 1327 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Andre
Top achievements
Rank 1
Andre asked on 12 Jul 2016, 01:12 AM

I get a {"'{DependencyProperty.UnsetValue}' is not a valid value for property 'Background'."}

exception when I double click on a RadTreeListView , selected Item

Are there enough clues as to what to look for?

Version :2016.2.0503

Stack trace:

   at System.Windows.DependencyObject.GetEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, RequestFlags requests)
   at System.Windows.DependencyObject.GetValueEntry(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, RequestFlags requests)
   at System.Windows.DependencyObject.GetValue(DependencyProperty dp)
   at System.Windows.Controls.Border.get_Background()
   at System.Windows.Controls.Border.OnRender(DrawingContext dc)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.ArrangeVirtualizedCell(GridViewCellBase cell, Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 198
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.ArrangeVirtualizedCells(Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 101
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.ArrangeOverride(Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 260
   at Telerik.Windows.Controls.TreeListView.TreeListCellsPanel.ArrangeOverride(Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\TreeListView\TreeListCellsPanel.cs:line 204
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at Telerik.Windows.Controls.GridView.GridViewRowItem.ArrangeOverride(Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\GridView\Rows\GridViewRowItem.cs:line 249
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.ArrangeOverride(Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.FlatLayoutStrategy.cs:line 874
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.ArrangeOverride(Size finalSize) in c:\TB\3391\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 357

 

The code looks like this:

(MouseDoubleClick below, does not get called)

 <telerik:RadTreeListView
            Grid.Row="1"
            ItemsSource="{Binding Contacts}"
            SelectionMode="Single"
            SelectionUnit="FullRow"
            MouseDoubleClick="Control_OnMouseDoubleClick"
            SelectedItem="{Binding SelectedInvoice, Mode=TwoWay}"
            AutoGenerateColumns="False">


            
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Invoices}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
                                    Header="Name" />
                
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Number}"
                                    Header="Number" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Date, Converter={businessControls:DateConverter}}"
                                    Header="Due Date" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Total, Converter={converters1:CurrencyConverter}}"
                                    Header="Total" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Balance, Converter={converters1:CurrencyConverter}}"
                                    Header="Balance" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Allocated, Converter={converters1:CurrencyConverter}}"
                                    Header="Allocated" />
            </telerik:RadTreeListView.Columns>



        </telerik:RadTreeListView>


   

3 Answers, 1 is accepted

Sort by
0
Andre
Top achievements
Rank 1
answered on 12 Jul 2016, 02:21 AM
I know a bit more, and I need to know a bit more; The problem is around the selected item, so what is the best way to bind to the selection ?
0
Accepted
Dilyan Traykov
Telerik team
answered on 14 Jul 2016, 11:59 AM
Hello Andre,

I'm attaching a sample project to demonstrate how you can bind RadTreeListView's SelectedItem to a property in your view model.

Please let me know if such an approach would work for you. If that is not the case, please provide more information about your exact setup and requirements and I will gladly assist your further.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Andre
Top achievements
Rank 1
answered on 15 Jul 2016, 01:01 AM

Hi Dilyan,

I guess that did not really answer my question, but it did give me a clue.

The RadTreeListView actually wants to go into edit mode; In my case that is not required (or desired)

 Its just used as an hierarchical selector, inside a data-grid. (edit template)

As it attempts to go into edit mode, it seemingly gets lost searing the visual tree; and crashes somewhere up the parent data-grid.

I fixed it for now by making the columns read only.

 

Tags
TreeListView
Asked by
Andre
Top achievements
Rank 1
Answers by
Andre
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or