TreeViewAdv node selection

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

1 Reply

MU Murugan Syncfusion Team 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

Loader.
Up arrow icon