How to enter Editmode directly when keydown in node selection state in radTreeView

1 Answer 90 Views
Treeview
Jay
Top achievements
Rank 1
Jay asked on 18 Jan 2023, 06:17 AM

When I select an item using radTreeView and press any key, I want to enter Editmode immediately.

 

Please let me know if there is any way.

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 18 Jan 2023, 09:50 AM

Hi Jay,

To start the editing process of the selected node, you need to call the BeginEdit() method. You can check the Editing Nodes help article which further describes the editing functionality of the RadTreeView. In your case, you can subscribe to the KeyDown event of the RadTreeView and call the BeginEdit() of the RadTreeView.

public Form1()
{
    InitializeComponent();
    radTreeView1.AllowEdit = true;
    this.radTreeView1.KeyDown += RadTreeView1_KeyDown;
}

private void RadTreeView1_KeyDown(object sender, KeyEventArgs e)
{
    // You can add custom logic to check which key is pressed
    radTreeView1.BeginEdit();
}

I am not familiar with your requirements, but what I can suggest is to add custom logic that checks which key is pressed and enter the edit mode in only those scenarios.

I hope that my reply is helpful.

Regards,
Dinko | Tech Support Engineer
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
Jay
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or