Error when editing cell child

5 posts, 0 answers
  1. Mark
    Mark avatar
    8 posts
    Member since:
    Nov 2010

    Posted 10 Feb 2011 Link to this post

    Hi

    I have problem in using RadTreeListview

    When editing the parent cell, there is no problem on editing cell. However, editing child cell commits error. See attached picture file.
    Can anyone help me on this please?

    Here is My XAML Code

    ----------------------------------------

     

     

     

    <UserControl x:Class="TreeListView.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        d:DesignHeight="318" d:DesignWidth="624">

        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadTreeListView telerik:RadDragAndDropManager.AllowDrop="True" HorizontalAlignment="Stretch"  x:Name="rtvCostView" VerticalAlignment="Stretch" VerticalContentAlignment="Center"  RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserResizeColumns="True" CanUserSortColumns="False" IsFilteringAllowed="False" IsReadOnly="False" Visibility="Visible"  ShowColumnHeaders="True" Margin="0,0,100,0" >
                <telerik:RadTreeListView.GridViewGroupPanel>
                    <telerik:GridViewGroupPanel IsTabStop="False"  />
                </telerik:RadTreeListView.GridViewGroupPanel>
                <telerik:RadTreeListView.ChildTableDefinitions>
                    <telerik:TreeListViewTableDefinition   ItemsSource="{Binding items}"  />
                </telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:RadTreeListView.Columns>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name"  UniqueName="Name" Width="20*" TextWrapping="Wrap" />
                </telerik:RadTreeListView.Columns>
            </telerik:RadTreeListView>
        </Grid>
    </UserControl>

    -----------------------------------

    Here is my code

    Imports System.Collections.ObjectModel
    Imports System.ComponentModel
    Imports System.Collections.Specialized

    Partial Public Class MainPage
        Inherits UserControl
        Dim _Proposal As New ObservableCollection(Of clsProposal)
        Public Sub New()
            InitializeComponent()
            Dim clsProposal As New clsProposal

            clsProposal = New clsProposal
            clsProposal.Code = 1
            clsProposal.Name = "Breakfast"
            _Proposal.Add(clsProposal)

            Dim cItem As New clsItems

            cItem = New clsItems
            cItem.Code = 1
            cItem.Name = "Bacon"
            _Proposal(0).items.Add(cItem)

            cItem = New clsItems
            cItem.Code = 1
            cItem.Name = "Egg"
            _Proposal(0).items.Add(cItem)

            rtvCostView.ItemsSource = _Proposal
        End Sub

    End Class

    Public Class clsProposal
        Implements INotifyPropertyChanged

        Private _CodeProposal As Integer
        Private _Name As String
        Private _items As ObservableCollection(Of clsItems)

        Public Event PropertyChanged As PropertyChangedEventHandler _
        Implements INotifyPropertyChanged.PropertyChanged

        Public Sub NotifyPropertyChanged(ByVal propertyName As String)
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))

        End Sub

        Public Sub New()

            _CodeProposal = 0
            _Name = ""
            _items = New ObservableCollection(Of clsItems)
        End Sub

        Public Property Code As Integer
            Get
                Return _CodeProposal
            End Get
            Set(ByVal value As Integer)
                _CodeProposal = value
            End Set
        End Property
        Public Property Name As String

            Get
                Return _Name
            End Get
            Set(ByVal value As String)
                _Name = value
            End Set
        End Property

        Public Property items As ObservableCollection(Of clsItems)
            Get
                Return _items
            End Get
            Set(ByVal value As ObservableCollection(Of clsItems))
                _items = value
                NotifyPropertyChanged("items")
            End Set
        End Property

    End Class

    Public Class clsItems
        Implements INotifyPropertyChanged

        Private _CodeItem As Integer
        Private _ItemName As String

        Public Event PropertyChanged As PropertyChangedEventHandler _
            Implements INotifyPropertyChanged.PropertyChanged

        Public Sub NotifyPropertyChanged(ByVal propertyName As String)
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End Sub
        Public DataSourceChanged As EventHandler

        Public Sub New()
            _CodeItem = 0
            _ItemName = ""
        End Sub

        Public Property Code As Integer
            Get
                Return _CodeItem
            End Get
            Set(ByVal value As Integer)
                _CodeItem = value
            End Set
        End Property
        Public Property Name As String
            Get
                Return _ItemName
            End Get
            Set(ByVal value As String)
                _ItemName = value
            End Set
        End Property

    End Class



    -----------------




     

     

     

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 10 Feb 2011 Link to this post

    Hi,

     Can you post the full stack trace and more info about the treelist version? 

    All the best,
    Vlad
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Mark
    Mark avatar
    8 posts
    Member since:
    Nov 2010

    Posted 11 Feb 2011 Link to this post

    Hi

    My version of telerik is 2010.3.1110.1040


    Here is the error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
    Timestamp: Fri, 11 Feb 2011 09:50:39 UTC

    Message: Unhandled Error in Silverlight Application
    Code: 4004   
    Category: ManagedRuntimeError      
    Message: System.Reflection.TargetException: Object does not match target type.
       at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
       at Telerik.SilverlightExtensions.ReflectPropertyDescriptor.GetValue(Object component)    

    Line: 56
    Char: 13
    Code: 0
     
    I hope we could solve this problem

    Many Thanks
    Mark

  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 11 Feb 2011 Link to this post

    Hi Mark,

    I've just answered a ticket sent from Philip Padrones (maybe your colleague?) with exactly the same code. You can ask him for more info.

    Kind regards,
    Vlad
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. Paul
    Paul avatar
    24 posts
    Member since:
    Jul 2010

    Posted 25 Jul 2011 Link to this post

    Hi,

    I have encountered the same issue...

    Your suggestion for a customer to ask one of his co-workers is admirable, but without a link to the ticket or a detailed description, I can't see how that helps the rest of the community, You are creating work for yourselves when the rest of us start asking...

    Please can you advise what the fix to this was ?

    Thanks....
Back to Top
DevCraft banner