RadTreeViewItemEditedEventArgs returns the same object in the OldValue and NewValue properties.

1 Answer 19 Views
TreeView
Kostiantyn
Top achievements
Rank 1
Iron
Kostiantyn asked on 24 Jan 2024, 10:36 AM | edited on 25 Jan 2024, 06:33 AM

Currently I'm using a ProjectItem classes and FileItem classes into a RadTreeView for displaying the ProjectItem content. And when I'm trying to handle the Edited event, there occurs a problem with Old and New value, in case that given objects to RadTreeView.ItemsSource will be a reference type, it might create a problem. 

I would like to handle the Edited event for checking the NewValue, and according to conditions return there a OldValue.

Github with the solution

1 Answer, 1 is accepted

Sort by
1
Dimitar
Telerik team
answered on 26 Jan 2024, 11:27 AM

Hi Kostiantyn,

It appears to be an issue with our control. I have logged it on your behalf. You can track its progress, subscribe to status changes, and add your comment to it here:RadtreeView: RadTreeViewItemEditedEventArgs returns the same object in the OldValue and NewValue properties.  I have updated your Telerik points for this report. 

As a workaround you can us e the following approach: 

string currentEitedObject = null;
private void RadTreeView_EditStarted(object sender, Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs e)
{
    currentEitedObject = (e.OldValue as FileItem).Name;
}

public ObservableCollection<ProjectItem> Projects { get; }

private void RadTreeView_Edited(object sender, Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs e)
{
    string oldValue = currentEitedObject;
 
}

I want to apologize for the inconvenience this is causing you.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
TreeView
Asked by
Kostiantyn
Top achievements
Rank 1
Iron
Answers by
Dimitar
Telerik team
Share this question
or