DependencyProperty.UnsetValue

4 posts, 1 answers
  1. Andre
    Andre avatar
    6 posts
    Member since:
    Jul 2013

    Posted 11 Jul Link to this post

    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>


       

  2. Andre
    Andre avatar
    6 posts
    Member since:
    Jul 2013

    Posted 11 Jul Link to this post

    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 ?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 14 Jul Link to this post

    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.
  5. Andre
    Andre avatar
    6 posts
    Member since:
    Jul 2013

    Posted 14 Jul in reply to Dilyan Traykov Link to this post

    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.

     

Back to Top