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

How can I disable editing on the desired nodes?

1 Answer 348 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Serg
Top achievements
Rank 1
Veteran
Serg asked on 19 Jan 2021, 05:21 PM

How can I disable editing on the desired nodes? Tried through CustomRadTreeViewEditor as below but without success.

public override void BeginEdit()
        {
            TreeNodeElement nodeElement = this.OwnerElement as TreeNodeElement;
            if (nodeElement.Data.Level == 0)
            {
                base.EndEdit();
                return;
            }
            base.BeginEdit();
        }

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Jan 2021, 05:38 AM

Hello, Serg, 

RadTreeView offers the Editing event which is about to be fired when the user tries to edit a node. You can cancel this event if the edit operation is not allowed. If the event is canceled, no further action takes place. Thus, you can disable editing on the desired nodes.

The following help article is quite useful about getting familiar with the editing lifecycle in RadTreeView: https://docs.telerik.com/devtools/winforms/controls/treeview/editing/editing-nodes 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Treeview
Asked by
Serg
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or