We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeViewAdv node selection

Thread ID:

Created:

Updated:

Platform:

Replies:

55552 Jan 31,2007 07:29 PM UTC Jan 31,2007 11:00 PM UTC Windows Forms 1
loading
Tags: Tools
Mitch Todd
Asked On January 31, 2007 07:29 PM UTC

Hi,

I was wondering if there were some properties I could set, or if you could point me in the right direction on how to get the following behavior: I would like my tree view to act like the tree in Outlook Express 2003. When navigating the tree with a keyboard, the tree in Outlook merely focuses on the nodes until the user presses "Enter", then the node is selected. Is this possible with the Syncfusion Tree View?

Thanks,
Mitch

Murugan [Syncfusion]
Replied On January 31, 2007 11:00 PM UTC

Hi Mitch,

There is no straightforward method or property available in TreeViewAdv control to achieve this. We could achieve this by customizing the TreeViewAdv control and overriding OnKeyDown method.

Here is the code snippet:

class CustomTreeView : Syncfusion.Windows.Forms.Tools.TreeViewAdv
{
protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyData == System.Windows.Forms.Keys.Down )
{
this.ActiveNode = this.ActiveNode.NextSelectableNode;
}
else if ( e.KeyData == System.Windows.Forms.Keys.Up)
{
this.ActiveNode = this.ActiveNode.PrevSelectableNode;
}
else if (e.KeyData == System.Windows.Forms.Keys.Enter)
{
if (this.ActiveNode != null)
{
this.SelectedNode = this.ActiveNode;
}
}
else
{
base.OnKeyDown(e);
}
}
}

Herewith I have attached the sample. Please have a look at the sample and let me know if it helps you.

CustomTreeViewAdv

Thanks for using Syncfusion products.

Regards,
Murugan P.S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;